Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.7(EOL)
-
None
Description
MariaDB [test]> SELECT * FROM JSON_TABLE('11x1', '$' COLUMNS(o FOR ORDINALITY)) AS jt; |
ERROR 4038 (HY000): Syntax error in JSON text in argument 1 to function 'JSON_TABLE' at position 3 |
|
Query OK, 0 rows affected (0.000 sec) |
|
Query OK, 0 rows affected (0.000 sec) |
|
+------+ |
| @n |
|
+------+ |
| 2 |
|
+------+ |
1 row in set (0.000 sec) |
I don't know what to make out of it, clearly there is no 2nd row, but maybe it can be rationalized in some way based on internal JSON_TABLE implementation.
Also oddly, it doesn't apply to JSON docs which start erroneously, i.e.
MariaDB [test]> SELECT * FROM JSON_TABLE('x11', '$' COLUMNS(o FOR ORDINALITY)) AS jt; |
ERROR 4038 (HY000): Syntax error in JSON text in argument 1 to function 'JSON_TABLE' at position 1 |
|
MariaDB [test]> set @n= null; get diagnostics condition 1 @n = error_index; select @n; |
Query OK, 0 rows affected (0.000 sec) |
|
Query OK, 0 rows affected (0.000 sec) |
|
+------+ |
| @n |
|
+------+ |
| 1 |
|
+------+ |
1 row in set (0.000 sec) |
So, it looks like the counter is increased if the first symbol in the doc leaves hope that it is a valid document.
Maybe it's not ERROR_INDEX issue but the general counter's, but I haven't yet invented an example to verify it, so I'm keeping it a 10.7 / ERROR_INDEX issue for now.
Attachments
Issue Links
- is caused by
-
MDEV-10075 Provide index of error causing error in array INSERT
- Closed