-
- Downloads
Fix mysql humanize error (#23263)
* Correctly handle fall-through case. Condp is exhaustive and throws if nothing matches ``` mysql=> (condp = 2 1 :nope 3 :nope) Execution error (IllegalArgumentException) at metabase.driver.mysql/eval169387 (REPL:870). No matching clause: 2 mysql=> ``` and can take a single default clause at the end with no predicate ```clojure mysql=> (condp = 2 1 :nope :default-catch-all) :default-catch-all ``` This was attempted with a regex `#".*"` but this regex does not match everything! ```clojure mysql=> (driver/humanize-connection-error-message :mysql "hello\nthere") Execution error (IllegalArgumentException) at metabase.driver.mysql/eval167431$fn (mysql.clj:124). No matching clause: hello there mysql=> (re-matches #".*" "hi\nthere") nil ``` So just use use the message as the default to be returned which was the original intention. * Fix other databases as well
Showing
- modules/drivers/mongo/src/metabase/driver/mongo.clj 2 additions, 2 deletionsmodules/drivers/mongo/src/metabase/driver/mongo.clj
- modules/drivers/presto/src/metabase/driver/presto.clj 0 additions, 1 deletionmodules/drivers/presto/src/metabase/driver/presto.clj
- modules/drivers/snowflake/src/metabase/driver/snowflake.clj 1 addition, 1 deletionmodules/drivers/snowflake/src/metabase/driver/snowflake.clj
- src/metabase/driver/h2.clj 0 additions, 1 deletionsrc/metabase/driver/h2.clj
- src/metabase/driver/mysql.clj 1 addition, 1 deletionsrc/metabase/driver/mysql.clj
- src/metabase/driver/postgres.clj 0 additions, 1 deletionsrc/metabase/driver/postgres.clj
Loading
Please register or sign in to comment