Skip to content

Commit

Permalink
Merge pull request #1987 from zendesk/fix-odd-index-parse
Browse files Browse the repository at this point in the history
fix odd index parsing bug (#1982)
  • Loading branch information
osheroff authored Mar 11, 2023
2 parents b3e6023 + 08a7bd5 commit c4befac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/docs/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ When the HTTP server is enabled the following endpoints are exposed:

| endpoint | description |
|:---------------|:-------------------------------------------------------------------------------|
| `/metrics` | return all metrics as JSON |
| `/prometheus` | return all metrics as Prometheus format |
| `/metrics` | GET all metrics as JSON |
| `/prometheus` | GET all metrics as Prometheus format |
| `/healthcheck` | run Maxwell's healthchecks. Considered unhealthy if >0 messages have failed in the last 15 minutes. |
| `/ping` | a simple ping test, responds with `pong` |
| `/diagnostics` | for kafka, send a fake message that measures the client to server latency |


# JMX Configuration
Expand Down
3 changes: 2 additions & 1 deletion src/main/antlr4/imports/mysql_indices.g4
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ index_columns: index_column (',' index_column )*;

index_column:
name index_column_partial_def? index_column_asc_or_desc?
| '(' CAST skip_parens ')';
| skip_parens index_column_asc_or_desc?;


index_column_partial_def: '(' index_column_partial_length ')';
index_column_partial_length: INTEGER_LITERAL+;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ public void testParsingSomeAlters() {
"ALTER TABLE t1 DROP CHECK ck",
"create table test ( i float default -1. )",
"alter database d ENCRYPTION='Y'",
"ALTER TABLE t1 ADD COLUMN IF NOT EXISTS c1 TINYINT"
"ALTER TABLE t1 ADD COLUMN IF NOT EXISTS c1 TINYINT",
"ALTER TABLE tournaments ADD INDEX idx_team_name (('$.teams.name'))",
"ALTER TABLE tournaments ADD INDEX idx_team_name ((ABS(col)))",
"ALTER TABLE tournaments ADD INDEX idx_team_name ((col1 * 40) DESC)",
"CREATE TABLE employees (data JSON, INDEX idx ((CAST(data->>'$.name' AS CHAR(30)) COLLATE utf8mb4_bin)))"
};

for ( String s : testSQL ) {
Expand Down

0 comments on commit c4befac

Please sign in to comment.