Mysql ddl compiler fall back to default index args#13138
Mysql ddl compiler fall back to default index args#13138TiansuYu wants to merge 2 commits intosqlalchemy:mainfrom
Conversation
a2953b7 to
1bc953a
Compare
zzzeek
left a comment
There was a problem hiding this comment.
thanks, this looks really good, ill continue review
sqla-tester
left a comment
There was a problem hiding this comment.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 1bc953a of this pull request into gerrit so we can run tests and reviews and stuff
|
New Gerrit review created for change 1bc953a: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 |
|
the oracle failures are unrelated, it has some |
|
Gord Thompson (gordthompson) wrote: This appears to be the only thing that black would want to fix: Index: test/dialect/mysql/test_compiler.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/dialect/mysql/test_compiler.py b/test/dialect/mysql/test_compiler.py
--- a/test/dialect/mysql/test_compiler.py (revision 405f7faad9c422578272e1c0ee04e1c828978325)
+++ b/test/dialect/mysql/test_compiler.py (date 1771608649557)
@@ -269,12 +269,8 @@
def test_create_index_with_length(self, dialect_name):
m = MetaData()
tbl = Table("testtbl", m, Column("data", String(255)))
- idx1 = Index(
- "test_idx1", tbl.c.data, **{f"{dialect_name}_length": 10}
- )
- idx2 = Index(
- "test_idx2", tbl.c.data, **{f"{dialect_name}_length": 5}
- )
+ idx1 = Index("test_idx1", tbl.c.data, **{f"{dialect_name}_length": 10})
+ idx2 = Index("test_idx2", tbl.c.data, **{f"{dialect_name}_length": 5})
self.assert_compile(
schema.CreateIndex(idx1),View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 |
|
Gord Thompson (gordthompson) wrote: If the changelog is okay then I can do the backport, too. (I've never felt very confident at writing changelog entries.) View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 |
|
Gord Thompson (gordthompson) wrote: Done View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 |
|
I have fixed the lint. I am unaware of what needs to be back-ported. If someone can point that out to me, I can add that too. Otherwise, feel free to go ahead. |
sqla-tester
left a comment
There was a problem hiding this comment.
Michael Bayer (zzzeek) wrote:
code review left on gerrit
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601
| "test_idx1", tbl.c.data, mysql_length=10, mysql_prefix="FULLTEXT" | ||
| "test_idx1", | ||
| tbl.c.data, | ||
| **{ |
There was a problem hiding this comment.
Michael Bayer (zzzeek) wrote:
i wanted to make sure we had a positive test for the actual original problem.
this uses a new fixture to make the dialect reg thing easier
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601
|
Federico Caselli (CaselIT) wrote: Looks ok to me For 2.0 this is kinda a breaking change, since using mysql_lenght with mariadb or other dialect no longer works. Maybe we could better spell that out in the change note? View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 |
|
Michael Bayer (zzzeek) wrote: this is a good point and i think instead we should have a fallback for now we dont need more mysql regressions View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 |
|
Michael Bayer (zzzeek) wrote: can you review again? View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 |
|
Federico Caselli (CaselIT) wrote: that's what I had in mind too View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 |
|
This might be a naive suggestion: To make this backward compatible, e.g. could be changed to so the hard-coded parts for |
|
the code in the PR is outdated, it was already updated on gerrit. there is a new parameter in No further change is expect from you, thanks for the PR! |
|
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6601 has been merged. Congratulations! :) |
|
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6605 has been merged. Congratulations! :) |
Fixed issue where DDL compilation options were registered to the hard-coded dialect name ``mysql``. This made it awkward for MySQL-derived dialects like MariaDB, StarRocks, etc. to work with such options when different sets of options exist for different platforms. Options are now registered under the actual dialect name, and a fallback was added to help avoid errors when an option does not exist for that dialect. Pull request courtesy Tiansu Yu. Fixes: #13134 Closes: #13138 Pull-request: #13138 Pull-request-sha: 1bc953a Change-Id: Ifa700a4e34da4d1923e9473dd8f0d2417dcfded4 (cherry picked from commit 8c26205)
Description
Fixes: #13134
Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>in the commit messageinclude a complete example of how the feature would look.
Fixes: #<issue number>in the commit messageHave a nice day!