SHOW ERRORS

    语句用于显示已执行语句中的错误。一旦先前的语句成功执行,就会清除错误缓冲区,这时 SHOW ERRORS 会返回一个空集。

    ShowErrorsStmt:

    1. ERROR 1054 (42S22): Unknown column 'invalid' in 'field list'
    1. create invalid;
    1. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 14 near "invalid"
    1. | Level | Code | Message |
    2. | Error | 1054 | Unknown column 'invalid' in 'field list' |
    3. | Error | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 14 near "invalid" |
    4. +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
    5. 2 rows in set (0.00 sec)
    1. CREATE invalid2;
      1. +------+
      2. +------+
      3. | 1 |
      4. +------+
      5. 1 row in set (0.00 sec)
      1. SHOW ERRORS;

        SHOW ERRORS 语句与 MySQL 完全兼容。如发现任何兼容性差异,请在 GitHub 上提交 。