diff --git a/spec/mysql2/client_spec.rb b/spec/mysql2/client_spec.rb index 5a443b228..5a1b45d4b 100644 --- a/spec/mysql2/client_spec.rb +++ b/spec/mysql2/client_spec.rb @@ -232,7 +232,15 @@ def connect *args it "should > 0" do # "the statement produces extra information that can be viewed by issuing a SHOW WARNINGS" # http://dev.mysql.com/doc/refman/5.0/en/explain-extended.html - @client.query("explain extended select 1") + begin + @client.query("explain extended select 1") + rescue Mysql2::Error + # EXTENDED keyword is deprecated in MySQL 8.0 and triggers a syntax error + # https://dev.mysql.com/doc/refman/5.7/en/explain-extended.html + # "extended output is now enabled by default, so the EXTENDED keyword is superfluous and + # deprecated ... and it will be removed from EXPLAIN syntax in a future MySQL release" + @client.query("explain select 1") + end @client.warning_count.should > 0 end end