From 2e3c0c0ca33dfa42b58c7455b8b233b60c1a938b Mon Sep 17 00:00:00 2001 From: Groene AI <270696204+groeneai@users.noreply.github.com> Date: Sat, 28 Nov 2026 12:18:28 +0000 Subject: [PATCH] fix(clickhouse): tolerate the decimal reader's exponent parse errors Comparing a decimal with a random string literal makes the server convert the string to the decimal type. A string starting with e/E enters the decimal reader's exponent branch, which throws CANNOT_PARSE_NUMBER ("Cannot parse exponent while reading decimal", or "Exponent is out of range while reading decimal" when the exponent overflows Int32), and convertFieldToType passes it through instead of rewriting it to TYPE_MISMATCH "Cannot convert string". The integer and float readers' wordings for the same shape are already expected; these two were not, so CODDTest reported the raw SQLException (NightlySQLancer, SQLancer (arm_release), master 9c5336e66e25, 2026-11-28). Related: https://github.com/ClickHouse/ClickHouse/issues/128538 Co-Authored-By: Claude Opus 5.5 --- src/sqlancer/clickhouse/ClickHouseErrors.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sqlancer/clickhouse/ClickHouseErrors.java b/src/sqlancer/clickhouse/ClickHouseErrors.java index 7e41ca955..8c9d171d1 100644 --- a/src/sqlancer/clickhouse/ClickHouseErrors.java +++ b/src/sqlancer/clickhouse/ClickHouseErrors.java @@ -22,6 +22,7 @@ public static List getExpectedExpressionErrors() { "Cannot parse number with a sign character but without any numeric character", "Cannot parse number without any digits", "Cannot parse number with multiple sign (+/-) characters or intermediate sign character", + "Cannot parse exponent while reading decimal", "Exponent is out of range while reading decimal", "Cannot parse string", "Cannot read floating point value", "Cyclic aliases: default expression and column type are incompatible", "Directory for table data", "Directory not empty", "Expected one of: compound identifier, identifier, list of elements (version",