Skip to content

Commit

Permalink
Update info_schema_auto_increment.go (#833)
Browse files Browse the repository at this point in the history
Fix case in auto increment collector where two tables only differ base case.

Signed-off-by: Nicole Chen <51746100+nicolevv@users.noreply.github.com>
  • Loading branch information
nicolevv authored Aug 29, 2024
1 parent 5e63bbe commit 3a996a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions collector/info_schema_auto_increment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

const infoSchemaAutoIncrementQuery = `
SELECT table_schema, table_name, column_name, auto_increment,
SELECT c.table_schema, c.table_name, column_name, auto_increment,
pow(2, case data_type
when 'tinyint' then 7
when 'smallint' then 15
Expand All @@ -32,7 +32,7 @@ const infoSchemaAutoIncrementQuery = `
when 'bigint' then 63
end+(column_type like '% unsigned'))-1 as max_int
FROM information_schema.columns c
STRAIGHT_JOIN information_schema.tables t USING (table_schema,table_name)
STRAIGHT_JOIN information_schema.tables t ON (BINARY c.table_schema=t.table_schema AND BINARY c.table_name=t.table_name)
WHERE c.extra = 'auto_increment' AND t.auto_increment IS NOT NULL
`

Expand Down

0 comments on commit 3a996a4

Please sign in to comment.