pgloader
pgloader copied to clipboard
MySQL's utf8mb3 (formerly utf8) not supported?
We've recently upgraded Mysql to 8.x and pgloader cant load MySQL data anymore. It seems the MySQL's charset/collation rename from utf8 to utf8mb3 is the issue.
pgloader version "3.6.3~devel" compiled with SBCL 2.1.11.debian
2024-06-30T07:14:21.871987Z ERROR mysql: 255 fell through ECASE expression. Wanted one of (2 3 4 5 6 8 9 10 11 14 15 17 20 21 23 27 28 30 31 32 33 35 41 42 45 46 47 48 49 50 51 52 54 55 56 60 61 62 63 64 65 69 72 77 78 79 82 83 87 90 92 93 94 95 96 97 98 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 254).
Trying
DECODING TABLE NAMES MATCHING 'oneTable' AS utf8
and that is producing:
KABOOM! FATAL error: The value #(#S(SB-IMPL::EXTERNAL-FORMAT :NAMES (:ASCII :US-ASCII :ANSI_X3.4-1968 :ISO-646 :ISO-646-US :|646|) :DEFAULT-REPLACEMENT-CHARACTER #? :READ-N-CHARS-FUN #<FUNCTION SB-IMPL::FD-STREAM-READ-N-CHARACTERS/ASCII> :READ-CHAR-FUN #<FUNCTION SB-IMPL::INPUT-CHAR/ASCII> :WRITE-N-BYTES-FUN #<FUNCTION SB-IMPL::OUTPUT-BYTES/ASCII> :WRITE-CHAR-NONE-BUFFERED-FUN #<FUNCTION SB-IMPL::OUTPUT-CHAR-ASCII-NONE-BUFFERED> :WRITE-CHAR-LINE-BUFFERED-FUN #<FUNCTION SB-IMPL::OUTPUT-CHAR-ASCII-LINE-BUFFERED> :WRITE-CHAR-FULL-BUFFERED-FUN #<FUNCTION SB-IMPL::OUTPUT-CHAR-ASCII-FULL-BUFFERED> :RESYNC-FUN #<FUNCTION SB-IMPL::RESYNC/ASCII> :BYTES-FOR-CHAR-FUN #<FUNCTION SB-FASL::FOP-INT-CONST1> :READ-C-STRING-FUN #<FUNCTION SB-IMPL::READ-FROM-C-STRING/ASCII> :WRITE-C-STRING-FUN #<FUNCTION SB-IMPL::OUTPUT-TO-C-STRING/ASCII> :OCTETS-TO-STRING-FUN #<FUNCTION (LAMBDA (&REST REST) :IN "SYS:SRC;CODE;EXTERNAL-FORMATS;ENC-BASIC.LISP") {53DF50AB}> :STRING-TO-OCTETS-FUN #<FUNCTION (LAMBDA (&REST REST) :IN "SYS:SRC;CODE;EXTERNAL-FORMATS;ENC-BASIC.LISP") {53DF51AB}>) ...
is not of type
HASH-TABLE
@dimitri would it be easy for you to make pgloader aware of the 'utf8mb3' charset in MySql 8.x? Thank you
Are there any plans to make pgloader work for MySql 8.x migrations? Thanks
2024-06-30T07:14:21.871987Z ERROR mysql: 255 fell through ECASE expression.
This error comes from QMyND. 255 is utf8mb4_0900_ai_ci and that's the new default charset and collation for MySQL 8. Support for it was added to QMyND in 2019 (https://github.com/qitab/qmynd/pull/11). Also added that year was support for utf8_tolower_ci (76). Both of these are missing from the ECASE in your error message. I assume that means the QMyND you're using is from 2018. Can you upgrade it?
MySQL's rename of utf8 to utf8mb3 should have no bearing on this as the protocol speaks in IDs (e.g., 255) and the IDs for the charsets and collations remain unchanged.
I am not sure what QMyND is and what exactly I need to upgrade. At the time of filing this ticket I built pgloader from the latest sources I believe.
I assume that means the QMyND you're using is from 2018. Can you upgrade it? is this a question to @dimitri ?
QMyND is the MySQL driver that pgloader uses to talk to MySQL servers. It's cloned into pgloader's tree when building from source.
The question was not for @dimitri, but for you. If you're not sure how to do that, can you try with a newer version of pgloader, either built from source or from a more up to date package source?
Got it. It's good to know that an upgrade is possible to fix this.I'll look into this. I ended up importing from MySQL 8.x back to 5.x through mysqldump, data massaging, and then using pgloader.
Thank you
On Thu, Dec 5, 2024 at 9:47 AM Alejandro R. Sedeño @.***> wrote:
QMyND is the MySQL driver that pgloader uses to talk to MySQL servers. It's cloned into pgloader's tree when building from source.
The question was not for @dimitri https://github.com/dimitri, but for you. If you're not sure how to do that, can you try with a newer version of pgloader, either built from source or from a more up to date package source?
— Reply to this email directly, view it on GitHub https://github.com/dimitri/pgloader/issues/1592#issuecomment-2520522896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAICCI7PC5HURVDA2IZCKKL2EBROLAVCNFSM6AAAAABKD3TPX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRQGUZDEOBZGY . You are receiving this because you authored the thread.Message ID: @.***>
I've had the latest version from apt-get and that one does not work for me.
pgloader is already the newest version (3.6.3-1ubuntu1)
I will try to build.