Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.8.2, 10.6, 10.7(EOL), 10.8(EOL)
-
None
-
Docker official image https://hub.docker.com/_/mariadb
Description
The following SELECT statement:
SELECT u.id as any_id, u.*, attrs.*
|
FROM SyncopeUser u, JSON_TABLE(COALESCE(plainAttrs, '[{}]'), '$[*]' COLUMNS (
|
plainSchema VARCHAR(255) PATH '$.schema',
|
NESTED PATH '$.values[*]' COLUMNS (
|
binaryValue LONGBLOB PATH '$.binaryValue',
|
booleanValue INT PATH '$.booleanValue',
|
dateValue BIGINT(20) PATH '$.dateValue',
|
doubleValue DOUBLE PATH '$.doubleValue',
|
longValue BIGINT(20) PATH '$.longValue',
|
stringValue VARCHAR(255) PATH '$.stringValue'),
|
attrUniqueValue JSON PATH '$.uniqueValue')
|
) AS attrs
|
returns only NULL values for the attrUniqueValue column, even though the value from the plainAttrs column are as follows:
[
|
{
|
"values": [
|
{
|
"stringValue": "Rossini"
|
}
|
],
|
"schema": "surname"
|
},
|
{
|
"values": [
|
{
|
"dateValue": 1243288800000
|
},
|
{
|
"dateValue": 1274824800000
|
}
|
],
|
"schema": "loginDate"
|
},
|
{
|
"uniqueValue": {
|
"stringValue": "Gioacchino Rossini"
|
},
|
"schema": "fullname"
|
},
|
{
|
"uniqueValue": {
|
"stringValue": "rossini@apache.org"
|
},
|
"schema": "userId"
|
}
|
]
|
The same exact query run against MySQL 8.0 produces the expected result, e.g. for some rows the uniqueValue column being a JSON column with values:
{
|
"stringValue": "rossini@apache.org"
|
}
|
or
{
|
"stringValue": "Gioacchino Rossini"
|
}
|
Attachments
Issue Links
- relates to
-
MDEV-34644 CREATE VIEW: NULL values from JSON NESTED PATH with JSON column
- Confirmed
- links to