SQL Error with Datatables JS BIN environment
SQL Error with Datatables JS BIN environment
kthorngren
Posts: 21,322Questions: 26Answers: 4,948
in Bug reports
If orderable
is set false on the first column with server side processing the following error occurs:
DataTables warning: table id=example - An SQL error occurred: 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 'LIMIT 0, 10' at line 5
Here is the test case:
http://live.datatables.net/capiniyu/1/edit
Kevin
This discussion has been closed.
Replies
This thread should help, it's asking the same thing. And here's your test case updated with the recommendation.
Cheers,
Colin
I don't use server side processing and never paid attention to the
columns[i][orderable]
parameter. The docs do state this:I would say thats a bit of a flaw and unexpected behavior as the
columns.orderable
docs state this:Strict adherence to the
columns[i][orderable]
parameter negates the use oforder
ororder()
for those columns. I suggest putting a note in thecolumns.orderable
stating this. Along with a workaround like having a hidden column and using something likecolumns.orderData
.Also maybe a note in the
order
andorder()
docs stating the usage ofcolumns.orderable
may affect server side processing.Kevin
Hi Kevin,
Many thanks for flagging this up. I've added an extra example here.
I actually don't like the
orderable
parameter being sent to the server-side. I've come to think that it isn't up to the client-side to tell the server-side if a column should be searchable or orderable. It is the other way around!Come v2 I'm considering dropping those two parameters in the server-side processing data sent.
Allan
Great, thanks! I can understand these might be useful well at least the searchable parameter.
Kevin