Huh. Sorry, I didn't notice the change to the value being switch'ed on. Why change this? This is a pretty dangerous (IMHO) deviation from MySQL which may cause problems, and is unnecessary. Why not just stick with exactly what MySQL is doing in 5.6, plus whatever minor changes are needed to support MariaDB-format microsecond time?
Because changes to support MariaDB format make switch into a dead code. Or into redundant code, depending on whether I put if() before the switch or after. Because this if() has to be there, and it does cover all temporal type variants, MariaDB or MySQL.
I rather add a test case to verify that 5.6-style temporal2 types are mapped correctly.
Ah, I think I misunderstood your original statement about the switch(). The code looks fine, I think. Regards, Jeremy