SQLYog automatically appending LIMIT 0, 1000 to all queries - mysql

SQLyog automatically appending LIMIT 0, 1000 to all queries in a database which is causing the below query (select next_hi from hibernate_unique_key for update) to fail.
Query : select next_hi from hibernate_unique_key for update **LIMIT 0, 1000**
Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 1000' at line 2
The same is not happening in other database. Where to check and solve this problem?
UPDATE: It seems SQLyog is appending the LIMIT clause, no problem from hibernate or command prompt.
But it is happening in only one database not happening in the other database.

This was a bug which was fixed in SQLyog 8.4. SQLyog bug fix(8.4)-- On executing SELECT statements having clauses like PROCEDURE, INTO FILE, FOR UPDATE, etc., SQLyog was adding LIMIT clause if result tab paging option is enabled. The latest version of SQLyog can be found here.

Related

Invalid syntax in WHILE loop for MySQL 8.0.26

I'm running MySQL 8.0.26 inside a Linux container, using Docker.
I am attempting to run a stress test by infinitely selecting data from a table named employees in the employees database. To attempt this, I am embedding a SELECT statement inside of a WHILE loop, with a search condition that always returns true.
I am attempting to issue the following query against the MySQL engine, using the MySQL CLI tool.
WHILE 1=1 DO
SELECT * FROM employees.employees;
END WHILE;
When I run this query, I receive the error message as follows.
Error invoking remote method 'DB_EXECUTE_CANCELLABLE_QUERY': Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHILE 1=1 DO SELECT * FROM employees.employees; END WHILE' at line 1
According to the MySQL documentation, I am using the correct syntax. What is wrong with this SQL statement?
Docs: MySQL Comparison Operators
Docs: MySQL WHILE Statement
The WHILE statement is only valid inside MySQL stored procedures, functions.

Sql Syntax error with Doctrine, probably because of change of Mysql version

I've programmed a project in symfony and mysql 5.6. then I uploaded my project to a remote server on 1&1. the remote server has mysql 5.7 version. All doctrine queries run ok and without problem. But when a user searches something, a request will be sent to the server and a doctrine query will be executed. Here it returns the following error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an
error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 'integer)
BETWEEN 1940 AND 2002) AND u0_.id <> 2' at line 1
I think, it is probably because of different versions of mysql. Because on localhost it runs without problem
Can you please help me how to solve it? is there a way to regenerate all the migrations according the new mysql version? or may be there is another solution?
thanks
I was using CAST('number' as integer) in mysql 5.6. It did ok. However in mysql 5.7 and I do not know why, it does not run ok. So I changed it to CAST('number' as UNSIGNED) and it works ok

Why select json data not working in the mariadb?

My query like this :
select `information`->'$."full_name"' as `homeroom`
from `classes`
If the query run in my database local, it works. No error
But if the query run in my database server, it does not works. There exist error like this :
#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 '>'$."full_name"' as `homeroom`
from `classes` LIMIT 0, 25' at line 1
If I run select version(),
My version database local : 8.0.15
My version database server : 10.0.38-MariaDB
Seems it does not work because my database server using mariadb
How can I solve this problem?
Update :
I using data type text to infomation field
JSON functions weren't added to MariaDB until version 10.2.3. If you can't upgrade you will have to process the data in your application. Note that even in versions that support JSON, they don't support the -> notation (reference) so you will have to rewrite the query as
JSON_EXTRACT(information, '$.full_name')

PHPMyAdmin has retained a bad query I typed as the default "browse" query

Yesterday I typed a bad query into the SQL box of PHPMyAdmin.
Ever since, when I click on my database table in the bar on the left, or click the Browse button, my query is used as the default query. Or rather the part I typed at the end is added to every query.
I get an error dialog reading
#1064 - You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server
version for the right syntax to use near 'offset1000
LIMIT 0, 30' at line 1
which is my bad query. How can I get rid of this? Is there a cache with this query in it somewhere?
Details: PHPMyAdmin 4.0.10deb1ubuntu0.1 / Apache/2.4.7 (Ubuntu) / Ubuntu 14.04.1 and yes, I've logged out and even rebooted the server.
I have found the answer to this after a lot of searching.
PHPMyAdmin 4 has a table for this helpful feature.
It's in the database phpmyadmin, table pma_table_uiprefs. Stored against my username, that table and database was the bad query. I deleted it, which didn't help right away, but when I logged out and back in, it was gone.

Syntax error in MySQL WITH ROLLUP query in MySQL Workbench?

Any idea why the following query syntax is wrong:
SELECT year, sum(profit)
FROM BASEDATA b
group by year WITH rollup
Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near.....
MYSQL Version 5.0.77-community-log
It appears to be a bug in MySQL Workbench...the query runs fine under MySQL Query Browser.
Same error, but i found a discussion :
mysql WITH ROLLUP
if execute the query with ctrl+enter you get error, but if you execute with ctrl+alt+enter
then the query is ok!
Hope the fix this bug...