Repository navigation
Conversation
|
Qodo's finding on SQL Server It reaches beyond Should I keep it as is, or limit it to columns with a |
|
Hi, @xue-ding-e |
|
Thanks @noahisdai. I reviewed the scope question at c60b5b1. Please keep the numeric length / mssql.MAX conversion limited to columns with an active mssql dialectTypes override in this PR, for example by checking column.dialectTypes?.[this.options.type] !== undefined. Please retain the three MAX-type cases and the bounded override case, and add coverage for:
The existing logical-MAX test currently expects the broader change, so that expectation would need to change with the narrower scope. A general SQL Server length-binding normalization can be evaluated separately. This is a scope recommendation, not a claim that the broader change has a demonstrated regression. I have not independently rerun the live-database matrix. This is not full-PR approval. AI-assisted review. |
Description of change
Follow-up to typeorm#12884, based on
de58583. Fixes the five open Qodo findings, with separate commits per finding.66e4814perf: cache resolveDriverColumn projections per driverbuild()0f39016fix: drop inherited collation from non-collatable overrides on all driversCOLLATEon non-text overrides. Each driver now declareswithCollationColumnTypes, replacing the Postgres-only setec576ef+86c55abkeep MySQL override numeric defaults in MysqlDriverdecimal(4,2)default of1.23overridden tovarcharwas emitted as'1'. Handled inMysqlDriver.normalizeDefault, only for columns with an overridea378badfix: check MariaDB override timestamp precision in the MySQL driversTableUtilsintoMysqlDriver/AuroraMysqlDriverc60b5b1fix: bind SQL Server lengths as numbers and max as the mssql MAX constantparametrizeValuepassed the length string ("max","100") behindas any. Lengths are now numbers andmaxismssql.MAX, matchingMssqlParameter'slength?: number; the generated SQL is unchangedbdb0a61,2ba004eMariaDB's precision rules differ from MySQL's (checked on 10.11.19 and 12.3.3, strict mode):
ON UPDATEless precise than the columnERROR 1294 Invalid ON UPDATE clauseON UPDATEmore preciseDEFAULTmore preciseDEFAULTless preciseTested
Expression type int is invalid for COLLATE clause,COLLATE declaration for non-string-typed column,Invalid ON UPDATE clause, and the default stored as1Unit tests: 354 passing. After the bind change, the SQL Server columns, insert, update and repository suites pass (103), including the
mssql-parametersMAX bind test. The schema-builder suites on SQL Server hit request timeouts on my machine (emulated on Apple Silicon). The one I rechecked, the FKchange columntest, passes with a longer request timeout.AI-assisted implementation and testing.
Pull-Request Checklist
masterbranch (de58583)