-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Hello,
I'm using H2 for integration tests on a daily basis, and I think I found a syntax mismatch in MySQL compatibility mode (MODE=MySQL) for the json_object function.
MySQL version: 5.7 and 8.0
H2 version: 2.1.210 and 2.1.214
Exemple 1:
select json_object('first_name', 'John', 'last_name', 'Doe');
MySQL Result: {"last_name": "Doe", "first_name": "John"}
H2 Result: not works (Syntax error in SQL statement)
Exemple 2:
select json_object('first_name': 'John', 'last_name': 'Doe');
MySQL Result: not works (bad SQL grammar)
H2 Result: {"first_name":"John","last_name":"Doe"}
Exemple 3:
select json_object(key 'first_name' value 'John', key 'last_name' value 'Doe');
MySQL Result: not works (bad SQL grammar)
H2 Result: {"first_name":"John","last_name":"Doe"}
Is it possible (or is it intended to) to have a compatible json_object syntaxe for MySQL compatibility mode?