Fix indexes introduced in #6348. (#6356)

The indexes introduced in #6348 were on the wrong table. The tests
did not catch them due to retries on the create table steps (the
first try created the table but not the bogus indexes; the second
try noticed that the table already existed and did nothing). This
patch doesn't fix the issue with the tests, since the best way to
do that would be to do the table and index creation in a
transaction; but, this is not supported by all of our supported
database engines.
This commit is contained in:
Gian Merlino 2018-09-25 20:49:13 -07:00 committed by Fangjin Yang
parent 034d006d24
commit a92a20e037
1 changed files with 7 additions and 6 deletions

View File

@ -217,9 +217,13 @@ public abstract class SQLMetadataConnector implements MetadataStorageConnector
tableName, getPayloadType(), getQuoteString()
),
StringUtils.format(
"CREATE INDEX idx_%1$s_datasource_used_end ON %1$s(dataSource, used, %2$send%2$s)",
"CREATE INDEX idx_%1$s_datasource_end ON %1$s(dataSource, %2$send%2$s)",
tableName,
getQuoteString()
),
StringUtils.format(
"CREATE INDEX idx_%1$s_datasource_sequence ON %1$s(dataSource, sequence_name)",
tableName
)
)
);
@ -264,14 +268,11 @@ public abstract class SQLMetadataConnector implements MetadataStorageConnector
+ ")",
tableName, getPayloadType(), getQuoteString()
),
StringUtils.format("CREATE INDEX idx_%1$s_used ON %1$s(used)", tableName),
StringUtils.format(
"CREATE INDEX idx_%1$s_datasource_end ON %1$s(dataSource, %2$send%2$s)",
"CREATE INDEX idx_%1$s_datasource_used_end ON %1$s(dataSource, used, %2$send%2$s)",
tableName,
getQuoteString()
),
StringUtils.format(
"CREATE INDEX idx_%1$s_datasource_sequence ON %1$s(dataSource, sequence_name)",
tableName
)
)
);