SHOW WARNINGS

SHOW WARNINGS statement can be used to retrieve the warning produced by the latest query. The error message will be returned along with the query itself:

  1. mysql> SELECT * FROM test1 WHERE MATCH('@@title hello') \G
  2. ERROR 1064 (42000): index test1: syntax error, unexpected TOK_FIELDLIMIT
  3. near '@title hello'
  4. mysql> SELECT * FROM test1 WHERE MATCH('@title -hello') \G
  5. ERROR 1064 (42000): index test1: query is non-computable (single NOT operator)
  6. mysql> SELECT * FROM test1 WHERE MATCH('"test doc"/3') \G
  7. *************************** 1\. row ***************************
  8. id: 4
  9. weight: 2500
  10. group_id: 2
  11. date_added: 1231721236
  12. 1 row in set, 1 warning (0.00 sec)
  13. mysql> SHOW WARNINGS \G
  14. *************************** 1\. row ***************************
  15. Level: warning
  16. Code: 1000
  17. Message: quorum threshold too high (words=2, thresh=3); replacing quorum operator
  18. with AND operator
  19. 1 row in set (0.00 sec)

SHOW VARIABLES

  1. SHOW [{GLOBAL | SESSION}] VARIABLES LIKE 'pattern'

It returns the current values of a few server-wide variables. Also, support for GLOBAL and SESSION clauses was added.

  1. mysql> SHOW GLOBAL VARIABLES;
  2. +--------------------------+-----------+
  3. | Variable_name | Value |
  4. +--------------------------+-----------+
  5. | autocommit | 1 |
  6. | collation_connection | libc_ci |
  7. | query_log_format | sphinxql |
  8. | log_level | info |
  9. | max_allowed_packet | 134217728 |
  10. | character_set_client | utf8 |
  11. | character_set_connection | utf8 |
  12. | grouping_in_utc | 0 |
  13. | last_insert_id | 123, 200 |
  14. +--------------------------+-----------+
  15. 9 rows in set (0.00 sec)
  1. mysql> show variables like '%log%';
  2. +------------------+----------+
  3. | Variable_name | Value |
  4. +------------------+----------+
  5. | query_log_format | sphinxql |
  6. | log_level | info |
  7. +------------------+----------+
  8. 2 rows in set (0.00 sec)
  1. mysql> show session variables like 'autocommit';
  2. +---------------+-------+
  3. | Variable_name | Value |
  4. +---------------+-------+
  5. | autocommit | 0 |
  6. +---------------+-------+
  7. 1 row in set (0.00 sec)

SHOW COLLATION

  1. SHOW COLLATION

This is currently a placeholder query that does nothing and reports success. That is in order to keep compatibility with frameworks and connectors that automatically execute this statement.

  1. mysql> SHOW COLLATION;
  2. Query OK, 0 rows affected (0.00 sec)