Closed mohammad-y closed 3 years ago
What version of MariaDB are you using? Make sure it supports JSON data types
@IsraelOrtuno I also had this issue and the problem in our case was not the JSON data type because MariaDB already supported it, kind of, just as an alias for LONG TEXT if I'm not mistaken. The issue is the syntax for searching in the json fields of the column name
which I don't think MariaDB supports. I'm running version 10.1.35, so maybe 10.2 or 10.3 have fixed this. I know 10.2 brought support for JSON functions like JSON_EXTRACT but I'm not sure about this specific syntax. I have yet to try it out.
I seem to be running into this same issue using MariaDB 10.2.22:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL
syntax; check the manual that corresponds to your MariaDB server version for the
right syntax to use near '>'$."$en"' asc' at line 1 (SQL: select * from `attributes`
where 0 = 1 order by `sort_order` asc, `name`->'$."$en"' asc)
[STACK] Line 624 in Connection.php
[STACK] Line 333 in Connection.php
[STACK] Line 1963 in Builder.php
[STACK] Line 1951 in Builder.php
[STACK] Line 2435 in Builder.php
@mschlachter You need to use MySQL or fork and change the code which is what I did. MariaDB versions that support JSON data types still doesn't work with the function used here, at least back when I had this issue.
I'm not sure if this issue is still valid. If you believe the JSON behavior with MariaDB is still buggy, feel free to re-open this issue with more details on how to reproduce it.
hello When using the package, I get the following error
rinvex\attributes\src\Traits\Attributable.php on line 178
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>'$."$en"' asc' at line 1 (SQL: select * from
attributes
where 0 = 1 order bysort_order
asc,name
->'$."$en"' asc)