where子句的更改顺序使查询中断

问题描述 投票:2回答:1

我使用MySQL 5.6遇到这种情况:

此查询有效并返回预期结果:

select *
from some_table
where a = 'b'
and metadata->>"$.country" is not null;

但是,此查询(唯一的区别是where子句的顺序返回错误)>

select *
from some_table
where metadata->>"$.country" is not null
and a = 'b';

MySQL返回的错误是

用于函数json_extract的参数1中的JSON文本无效:“无效值。”在位置0。

为什么?

我在使用MySQL 5.6的情况下遇到了这种情况:此查询有效并返回预期结果:从some_table中选择*,其中a ='b'并且元数据->>“ $。country”不为null;但是,此查询(...

mysql mysql-5.6
1个回答
0
投票

metdata列的值包含表中至少一行的格式错误的JSON。

© www.soinside.com 2019 - 2024. All rights reserved.