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

Database name in the meta information of Show Tables query #7320

Closed
GuptaManan100 opened this issue Jan 19, 2021 · 0 comments · Fixed by #7540
Closed

Database name in the meta information of Show Tables query #7320

GuptaManan100 opened this issue Jan 19, 2021 · 0 comments · Fixed by #7540

Comments

@GuptaManan100
Copy link
Member

Overview of the Issue

On running show tables in a keyspace named ks, the name of the database in the result should be information_schema and not ks.

Reproduction Steps

Found via an e2e test added in the testing mode found at https://github.com/planetscale/vitess/tree/testing-vtgate
Run the tests in the package and look at the logs.

Log Fragments

E0119 09:54:50.189567   64834 conn.go:1037] Outputs from both sources are different, Difference :  (*sqltypes.Result)(
- 	&{
- 		Fields: []*query.Field{
- 			s`name:"Tables_in_vt_ks" type:VARCHAR table:"TABLE_NAMES" org_table:"TABLE_NAMES" database:"ks" org_name:"TABLE_NAME" column_length:192 charset:33 flags:1 `,
- 		},
- 		RowsAffected: 0x10,
- 		Rows: [][]sqltypes.Value{
- 			{s`VARCHAR("aggr_test")`},
- 			{s`VARCHAR("t1")`},
- 			{s`VARCHAR("t1_id2_idx")`},
- 			{s`VARCHAR("t2")`},
- 			{s`VARCHAR("t2_id4_idx")`},
- 			{s`VARCHAR("t3")`},
- 			{s`VARCHAR("t3_id7_idx")`},
- 			{s`VARCHAR("t4")`},
- 			{s`VARCHAR("t4_id2_idx")`},
- 			{s`VARCHAR("t5_null_vindex")`},
- 			{s`VARCHAR("t6")`},
- 			{s`VARCHAR("t6_id2_idx")`},
- 			{s`VARCHAR("t7_fk")`},
- 			{s`VARCHAR("t7_xxhash")`},
- 			{s`VARCHAR("t7_xxhash_idx")`},
- 			{s`VARCHAR("vstream_test")`},
- 		},
- 	},
+ 	&{
+ 		Fields: []*query.Field{
+ 			s`name:"Tables_in_ks" type:VARCHAR table:"TABLE_NAMES" org_table:"TABLE_NAMES" database:"information_schema" org_name:"TABLE_NAME" column_length:192 charset:33 flags:1 `,
+ 		},
+ 		RowsAffected: 0x10,
+ 		Rows: [][]sqltypes.Value{
+ 			{s`VARCHAR("aggr_test")`},
+ 			{s`VARCHAR("t1")`},
+ 			{s`VARCHAR("t1_id2_idx")`},
+ 			{s`VARCHAR("t2")`},
+ 			{s`VARCHAR("t2_id4_idx")`},
+ 			{s`VARCHAR("t3")`},
+ 			{s`VARCHAR("t3_id7_idx")`},
+ 			{s`VARCHAR("t4")`},
+ 			{s`VARCHAR("t4_id2_idx")`},
+ 			{s`VARCHAR("t5_null_vindex")`},
+ 			{s`VARCHAR("t6")`},
+ 			{s`VARCHAR("t6_id2_idx")`},
+ 			{s`VARCHAR("t7_fk")`},
+ 			{s`VARCHAR("t7_xxhash")`},
+ 			{s`VARCHAR("t7_xxhash_idx")`},
+ 			{s`VARCHAR("vstream_test")`},
+ 		},
+ 	},
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant