Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain extended select 1 is not a valid statement since MySQL 8.0.3 #893

Closed
yahonda opened this issue Sep 23, 2017 · 1 comment
Closed

Comments

@yahonda
Copy link
Contributor

yahonda commented Sep 23, 2017

CI for #892 shows some failures. One of them is below:

$ bundle exec rspec ./spec/mysql2/client_spec.rb:328
Run options: include {:locations=>{"./spec/mysql2/client_spec.rb"=>[328]}}

Randomized with seed 11457

Mysql2::Client
  #warning_count
    when has a warnings
      should > 0 (FAILED - 1)

Failures:

  1) Mysql2::Client#warning_count when has a warnings should > 0
     Failure/Error: _query(sql, @query_options.merge(options))

     Mysql2::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 'select 1' at line 1
     # ./lib/mysql2/client.rb:120:in `_query'
     # ./lib/mysql2/client.rb:120:in `block in query'
     # ./lib/mysql2/client.rb:119:in `handle_interrupt'
     # ./lib/mysql2/client.rb:119:in `query'
     # ./spec/mysql2/client_spec.rb:331:in `block (4 levels) in <top (required)>'

Finished in 0.0126 seconds (files took 0.18505 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/mysql2/client_spec.rb:328 # Mysql2::Client#warning_count when has a warnings should > 0

Randomized with seed 11457

$

This is likely due to
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-3.html

The deprecated EXTENDED and PARTITIONS keywords for the EXPLAIN statement have been removed. These keywords are unnecessary because their effect is always enabled.

It also reproduces using mysql command line without mysql2 gem.

$ mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2463
Server version: 8.0.3-rc-log MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> explain extended select 1;
ERROR 1064 (42000): 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 'select 1' at line 1
mysql>

I have not found other sql statements showing warning in MySQL 8.0.3 yet.

@yahonda
Copy link
Contributor Author

yahonda commented Nov 11, 2017

Closed by #894

@yahonda yahonda closed this as completed Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant