MariaDB [test]> CREATE TABLE t ( id smallint(4) unsigned zerofill NOT NULL AUTO_INCREMENT primary key ) ;
|
Query OK, 0 rows affected (0,034 sec)
|
|
MariaDB [test]> insert into t values (),(),();
|
Query OK, 3 rows affected (0,012 sec)
|
Records: 3 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> SELECT JSON_OBJECT('id',id) FROM t;
|
+----------------------+
|
| JSON_OBJECT('id',id) |
|
+----------------------+
|
| {"id": 0001} |
|
| {"id": 0002} |
|
| {"id": 0003} |
|
+----------------------+
|
3 rows in set (0,000 sec)
|
|
MariaDB [test]> select json_valid(JSON_OBJECT('id',id)) from t;
|
+----------------------------------+
|
| json_valid(JSON_OBJECT('id',id)) |
|
+----------------------------------+
|
| 0 |
|
| 0 |
|
| 0 |
|
+----------------------------------+
|
3 rows in set (0,001 sec)
|
|
MariaDB [test]> select json_valid(JSON_OBJECT('id',cast(id as char))) from t;
|
+------------------------------------------------+
|
| json_valid(JSON_OBJECT('id',cast(id as char))) |
|
+------------------------------------------------+
|
| 1 |
|
| 1 |
|
| 1 |
|
+------------------------------------------------+
|
3 rows in set (0,001 sec)
|
|