Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Uint32 for SEQ_IN_INDEX in 'SHOW INDEXES' queries. #2502

Merged
merged 3 commits into from
May 22, 2024

Conversation

mkrautz
Copy link
Contributor

@mkrautz mkrautz commented May 19, 2024

This is seemingly the correct type for this field.

MySQL Connector/NET expects this for servers >8.0.1: https://github.com/mysql/mysql-connector-net/blob/8.4.0/MySQL.Data/src/SchemaProvider.cs#L298-L300

Fixes #2501

This is seemingly the correct type for this field.

MySQL Connector/NET expects this for servers >8.0.1:
https://github.com/mysql/mysql-connector-net/blob/8.4.0/MySQL.Data/src/SchemaProvider.cs#L298-L300

Fixes dolthub#2501
@timsehn
Copy link
Sponsor Contributor

timsehn commented May 20, 2024

@jycor is going to review.

Copy link
Contributor

@jycor jycor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mkrautz for the contribution!
This looks great.

Happy to merge this after adding this one test:

diff --git a/enginetest/queries/information_schema_queries.go b/enginetest/queries/information_schema_queries.go
index 7524dad0e..f31032f5e 100644
--- a/enginetest/queries/information_schema_queries.go
+++ b/enginetest/queries/information_schema_queries.go
@@ -335,6 +335,23 @@ var InfoSchemaQueries = []QueryTest{
        },
        {
                Query: `SHOW INDEXES FROM mytaBLE`,
+               ExpectedColumns: sql.Schema{
+                       &sql.Column{Name: "Table", Type: types.LongText},
+                       &sql.Column{Name: "Non_unique", Type: types.Int32},
+                       &sql.Column{Name: "Key_name", Type: types.LongText},
+                       &sql.Column{Name: "Seq_in_index", Type: types.Uint32},
+                       &sql.Column{Name: "Column_name", Type: types.LongText, Nullable: true},
+                       &sql.Column{Name: "Collation", Type: types.LongText, Nullable: true},
+                       &sql.Column{Name: "Cardinality", Type: types.Int64},
+                       &sql.Column{Name: "Sub_part", Type: types.Int64, Nullable: true},
+                       &sql.Column{Name: "Packed", Type: types.LongText, Nullable: true},
+                       &sql.Column{Name: "Null", Type: types.LongText},
+                       &sql.Column{Name: "Index_type", Type: types.LongText},
+                       &sql.Column{Name: "Comment", Type: types.LongText},
+                       &sql.Column{Name: "Index_comment", Type: types.LongText},
+                       &sql.Column{Name: "Visible", Type: types.LongText},
+                       &sql.Column{Name: "Expression", Type: types.LongText, Nullable: true},
+               },
                Expected: []sql.Row{
                        {"mytable", 0, "PRIMARY", 1, "i", nil, 0, nil, nil, "", "BTREE", "", "", "YES", nil},
                        {"mytable", 0, "mytable_s", 1, "s", nil, 0, nil, nil, "", "BTREE", "", "", "YES", nil},

@jycor jycor merged commit a6e5789 into dolthub:main May 22, 2024
7 checks passed
@mkrautz
Copy link
Contributor Author

mkrautz commented May 22, 2024

Thanks! I was about to add the test myself, since I didn't get to it yesterday. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problems with MySQL Connector/NET (Mysql.Data) and go-mysql-server
4 participants