Skip to content
Snippets Groups Projects
Unverified Commit 64062e87 authored by dpsutton's avatar dpsutton Committed by GitHub
Browse files

offset is a reserved word in mariadb as of 10.6 (#17101)

* offset is a reserved word in mariadb as of 10.6

- https://mariadb.com/kb/en/reserved-words/
- https://github.com/MariaDB/server/commit/299b935320

I think it is related to https://jira.mariadb.org/browse/MDEV-23908
"Implement SELECT ... OFFSET ... FETCH ..."

* Handle new names for utf8 in mariadb

https://mariadb.com/kb/en/unicode/

- utf8: Until MariaDB 10.5, this was a UTF-8 encoding using one to
three bytes per character. Basic Latin letters, numbers and
punctuation use one byte. European and Middle East letters mostly fit
into 2 bytes. Korean, Chinese, and Japanese ideographs use 3-bytes. No
supplementary characters are stored. From MariaDB 10.6, utf8 is an
alias for utf8mb3, but this can changed to ut8mb4 by changing the
default value of the old_mode system variable.

- utf8mb3: UTF-8 encoding using one to three bytes per
character. Basic Latin letters, numbers and punctuation use one
byte. European and Middle East letters mostly fit into 2
bytes. Korean, Chinese, and Japanese ideographs use 3-bytes. No
supplementary characters are stored. Until MariaDB 10.5, this was an
alias for utf8. From MariaDB 10.6, utf8 is by default an alias for
utf8mb3, but this can changed to ut8mb4 by changing the default value
of the old_mode system variable.
parent 4452329a
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,7 @@
" now(), convert_tz(now(), @@GLOBAL.time_zone, '+00:00')"
" ),"
" '%H:%i'"
" ) AS offset;")
" ) AS 'offset';")
[{:keys [global_tz system_tz offset]}] (jdbc/query spec sql)
the-valid-id (fn [zone-id]
(when zone-id
......
......@@ -86,11 +86,15 @@
(remove-utf8mb4-migrations! jdbc-spec)
(binding [db/*db-connection* jdbc-spec]
(testing (format "DB without migrations 107-160: UTF-8 shouldn't work when using the '%s' character set" charset)
(is (= {:character-set charset, :collation collation}
(db-charset)
(table-charset)
(column-charset))
(format "Make sure we converted the DB to %s correctly" charset))
(let [db-cs (db-charset)
tb-cs (table-charset)
col-cs (column-charset)]
(is (every? (cond-> #{charset} (= charset "utf8") (conj "utf8mb3"))
(map :character-set [db-cs tb-cs col-cs]))
(format "Make sure we converted the DB to %s correctly" charset))
(is (every? (cond-> #{collation} (= collation "utf8_general_ci") (conj "utf8mb3_general_ci"))
(map :collation [db-cs tb-cs col-cs]))
(format "Make sure we converted the DB to %s correctly" charset)))
(is (thrown?
Exception
(insert-row!))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment