Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.22
-
None
-
Ubuntu 16.04
Description
When json file contains 0 or "false" values, CONNECT JSON type shows them as NULL, unless a column declared explicitly as not null.
MariaDB [test]> \! cat /home/alice/Downloads/3.json
|
[
|
{
|
"i1": 0, |
"i2": false, |
"i3": null |
}
|
]
|
MariaDB [test]>source /home/alice/t/c.sql
|
Show warnings enabled.
|
--------------
|
|
create table t1( |
i1 int, |
i2 int, |
i3 int |
)engine=CONNECT table_type=JSON File_name='/home/alice/Downloads/3.json' |
--------------
|
Query OK, 0 rows affected (0.07 sec) |
|
--------------
|
select * from t1 |
--------------
|
+------+------+------+ |
| i1 | i2 | i3 |
|
+------+------+------+ |
| NULL | NULL | NULL | |
+------+------+------+ |
1 row in set (0.00 sec) |
|
create table t2( |
i1 int not null, |
i2 int not null, |
i3 int |
)engine=CONNECT table_type=JSON File_name='/home/alice/Downloads/3.json' |
--------------
|
Query OK, 0 rows affected (0.05 sec) |
|
--------------
|
select * from t2 |
--------------
|
+----+----+------+ |
| i1 | i2 | i3 |
|
+----+----+------+ |
| 0 | 0 | NULL | |
+----+----+------+ |
1 row in set (0.00 sec) |