[phpmyadmin/phpmyadmin] ce12a8: Fix #20284 - Preserve numeric strings in XML imports
Branch: refs/heads/QA_5_2 Home: https://github.com/phpmyadmin/phpmyadmin Commit: ce12a87858394d62e8acecd2f8b6cbfa7e7a3b2e https://github.com/phpmyadmin/phpmyadmin/commit/ce12a87858394d62e8acecd2f8b6... Author: Eyüp Can Akman <eyupcanakman@gmail.com> Date: 2026-04-28 (Tue, 04 April 2026) +03:00 Changed paths: A test/test_data/phpmyadmin_importXML_Numeric_String_For_Testing.xml M libraries/classes/Import.php M phpstan-baseline.neon M test/classes/Plugins/Import/ImportXmlTest.php Log Message: ----------- Fix #20284 - Preserve numeric strings in XML imports When the XML file embeds the table structure, $analyses is null and buildSql() falls back to is_numeric() to decide whether to quote. That strips quotes from values like "01234", which silently drops the leading zero on a varchar column and causes a duplicate-key error if the table also contains "1234". Add a roundtrip check: a value is still treated as numeric only when casting it to int or float gives back the original string. "01234", "1e10" and similar fail the roundtrip and stay quoted; plain integers like 1 and 1234 keep their existing unquoted form. Signed-off-by: Eyüp Can Akman <eyupcanakman@gmail.com> Commit: bd81cf82be2f0f65d399c317605502c7c36ccdb6 https://github.com/phpmyadmin/phpmyadmin/commit/bd81cf82be2f0f65d399c3176055... Author: Eyüp Can Akman <eyupcanakman@gmail.com> Date: 2026-04-30 (Thu, 04 April 2026) +03:00 Changed paths: M libraries/classes/Import.php Log Message: ----------- Simplify isVarchar check The !is_numeric guard is redundant; the round-trip already covers non-numeric inputs since (int) of a non-numeric string is 0. Signed-off-by: Eyüp Can Akman <eyupcanakman@gmail.com> Commit: b8d4ca52a936a6e8809cd0e53981dff4f26590de https://github.com/phpmyadmin/phpmyadmin/commit/b8d4ca52a936a6e8809cd0e53981... Author: Maurício Meneghini Fauth <mauricio@mfauth.com.br> Date: 2026-05-09 (Sat, 05 May 2026) -03:00 Changed paths: A test/test_data/phpmyadmin_importXML_Numeric_String_For_Testing.xml M libraries/classes/Import.php M phpstan-baseline.neon M test/classes/Plugins/Import/ImportXmlTest.php Log Message: ----------- Merge pull request #20296 from eyupcanakman/fix/xml-import-numeric-string-quoting Fix #20284 - Preserve numeric strings in XML imports
participants (1)
-
Eyüp Can Akman