Add test to verify failure for renaming to long table name#13289
Add test to verify failure for renaming to long table name#13289ebyhr merged 5 commits intotrinodb:masterfrom
Conversation
0a1f223 to
dec06a7
Compare
fc6eaea to
e7f9d5b
Compare
b897557 to
9a07904
Compare
|
CI |
There was a problem hiding this comment.
Long commit message - Ensure failure when creating invalid table name in testCreateTableWithLongTableName.
Would Verify failure for invalid table name in testCreateTableWithLongTableName work?
There was a problem hiding this comment.
Nice, also seems to fix the issue that we would throw raw SQLException instead of wrapping into a TrinoException.
There was a problem hiding this comment.
nit: Check target table name when renaming a table in MongoDB -> Check target table name length when renaming a table in MongoDB
There was a problem hiding this comment.
The MongoDB docs talk about bytes and it seems they don't disallow multibyte characters so instead of checking string length we should check bytes probably.
There was a problem hiding this comment.
nit: the var should probably be renamed since it's bytes now instead of length.
There was a problem hiding this comment.
nit: The comment is slightly confusing because it talks about 128 but does comparison with databaseMetadata.getMaxTableNameLength().
plugin/trino-kudu/src/test/java/io/trino/plugin/kudu/TestKuduConnectorTest.java
Outdated
Show resolved
Hide resolved
8283fd5 to
4db1f01
Compare
4db1f01 to
cf6752d
Compare
There was a problem hiding this comment.
nit: the var should probably be renamed since it's bytes now instead of length.
| // The connector appends uuids to the end of all table names | ||
| return OptionalInt.of(255 - UUID.randomUUID().toString().length()); | ||
| // 33 is the length of random suffix. e.g. {table name}-142763c594d54e4b9329a98f90528caf | ||
| return OptionalInt.of(255 - 33); |
There was a problem hiding this comment.
Previously, this test passed in Iceberg unintentionally because of its try-catch style. This change is required to adjust to the right max length.
cf6752d to
6665e10
Compare
|
CI hit #13107 |
Description
Add test to verify failure for renaming to long table name. The changes for MongoDB and SQL Server connectors are required to pass the test.
Fixes #13073
Documentation
(x) No documentation is needed.
Release notes
(x) Release notes entries required with the following suggested text: