Coder Social home page Coder Social logo

Comments (18)

alexkipkalo avatar alexkipkalo commented on July 2, 2024

Similar issue on my side:

CALL common_schema.foreach(
"SELECT table_schema FROM INFORMATION_SCHEMA.TABLES WHERE table_name = '<table_name>' ",
"UPDATE ${1}.<table_name> set ...... WHERE id = ");

show warnings ;
Error Code: 1644 ;
Message : QueryScript error: [Unsupported token: "sleep-"] at 7: "UPDATE ... ";

MySQL version : Percona 5.6.23-72.1 -- no error ;
MySQL version : Percona 5.6.27-rel75 -- error ;

from common_schema.

alexkipkalo avatar alexkipkalo commented on July 2, 2024

Do you know what it might be ?

from common_schema.

tersmitten avatar tersmitten commented on July 2, 2024

I think we have the same error, see.

Do you have any suggestions @shlomi-noach?

from common_schema.

ikewalker avatar ikewalker commented on July 2, 2024

I've tested this in 5.7 and gotten similar errors.

Looking more closely at 5.6, I tested each version of community server between 5.6.22 and 5.6.27, and 5.6.27 was the first version that started throwing the error.

So it appears to be a change between 5.6.26 and 5.6.27 that broke QueryScript.

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024

I can also confirm:

master [localhost] {msandbox} (common_schema) > call run("foreach ($s: select TABLE_SCHEMA FROM INFORMATION_SCHEMA.TABLES WHERE table_name LIKE 'samplet') {select * from :${s}.samplet}" );
ERROR 1644 (91100): QueryScript error: [Unsupported token: "startet"] at 8: "foreach ($s: select TABLE_SCHEMA FROM INFORMATION_SCHEMA.TABLES WHERE t
master [localhost] {msandbox} (common_schema) > call run("foreach ($s: select TABLE_SCHEMA FROM INFORMATION_SCHEMA.TABLES WHERE table_name LIKE 'samplet') {select * from :${s}.samplet}" );
ERROR 1644 (91100): QueryScript error: [Unsupported token: "

I'm looking into this. I cannot see an obvious hint in http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-27.html

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024
master [localhost] {msandbox} (common_schema) > call run('select * from _sql_tokens');
ERROR 1644 (91100): QueryScript error: [Unsupported token: "startt"] at 7: "select * from _sql_tokens"
master [localhost] {msandbox} (common_schema) > call run('select * from _sql_tokens');
ERROR 1644 (91100): QueryScript error: [Unsupported token: "

from common_schema.

tersmitten avatar tersmitten commented on July 2, 2024

We're also experiencing the problem in mysql 5.5 (5.5.46)

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024

Seems like MySQL introduced a bug in local routine variables.

These variables:

    declare first_token text;
    declare first_state text;

Are assigned via:

SELECT level, token, state FROM _sql_tokens WHERE id = id_from INTO statement_level, first_token, first_state;

With these legit values, select, alpha (first row):

+-----------+------------+----+-------+-------+--------+------------+
| server_id | session_id | id | start | level | token  | state      |
+-----------+------------+----+-------+-------+--------+------------+
|         1 |         19 |  1 |     7 |     0 | select | alpha      |
|         1 |         19 |  2 |     8 |     0 |        | whitespace |
|         1 |         19 |  3 |     9 |     0 | 1      | integer    |
|         1 |         19 |  4 |     9 |     0 |        | start      |
+-----------+------------+----+-------+-------+--------+------------+

and their values are immediately corrupted.

I'm looking to see whether I can overcome this bug, but it is very disconcerting as this coding style is all over the place.

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024

This seems to work around the problem:

      SELECT level, token, state FROM _sql_tokens WHERE id = id_from INTO @_statement_level, @_first_token, @_first_state;

      set statement_level=@_statement_level;
      set first_token=@_first_token;
      set first_state=@_first_state;

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024

O-M-G this is everywhere. This bug is creepy and happens on multiple occasions of SELECT... INTO <local-variable>. I'm replacing all occurrences, but I'm doing so hastily at this time.
I will need to step back and do this orderly. Meanwhile I can throw in a hopefully mostly fixed deployment file.

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024

Please find new sql file in https://github.com/shlomi-noach/common_schema/releases/tag/v2.3

from common_schema.

tersmitten avatar tersmitten commented on July 2, 2024

Thanks @shlomi-noach

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024

Is it confirmed the problem is solved on mentioned platforms?

from common_schema.

ikewalker avatar ikewalker commented on July 2, 2024

I can confirm that the problem is solved on all mentioned platforms that I tested. The one I did not test is MariaDB 1.0.22.

I tested the following versions:

MySQL Community Server 5.5.46
Percona Server 5.6.27
Percona Server 5.7.10-3
MySQL Community Server 5.7.11

I was able to install common_schema 2.3 on all of those versions with no errors, and I was able to successfully run the following QueryScript test:

call common_schema.run("
foreach ($t: select TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = 'mysql')
{select count(*) from mysql.:${t} }
" );

from common_schema.

genuss avatar genuss commented on July 2, 2024

I can confirm installation works too. Thank you for the fix. One little thing I mentioned is weird symbols in sql-file of release. Take a look for instance on line 13466.

from common_schema.

tersmitten avatar tersmitten commented on July 2, 2024
Server version: 5.5.48-37.8 Percona Server (GPL), Release 37.8, Revision c8ae1b6

also works

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024

@genuss thanks - can you kindly open a new issue for the strange chars? Probably my mac's version of html2text

from common_schema.

shlomi-noach avatar shlomi-noach commented on July 2, 2024

thanks all, closing this issue

from common_schema.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.