0

i try to execute following statement on my heidisql mariadb db:

UPDATE users SET inventory=JSON_REMOVE(inventory,'$.spray');

it already worked on phpmyadmin on other databases, but not here.

I get the following error:

enter image description here

someone knows about this ? Thanks in Advance :)

Paul T.
  • 4,703
  • 11
  • 25
  • 29
Soubi
  • 1

1 Answers1

0

The error complains about "argument 1", which is the users.inventory column in your case. Means you have some invalid JSON code, in one or more rows of your users table. You have to find and fix that invalid JSON in the table, probably by scrolling through HeidiSQL's data tab result.

By the way, I can only reproduce the error on MySQL 5.7, not on MariaDB 10.3 or 10.5.

*Edit: you may find the invalid rows easily, with such a query:

SELECT * FROM `users` WHERE NOT JSON_VALID(`inventory`);
Anse
  • 1,573
  • 12
  • 27