エラーを表示

このステートメントは、以前に実行されたステートメントのエラーを表示します。ステートメントが正常に実行されるとすぐにエラー バッファーはクリアされます。その場合、 SHOW ERRORS空のセットを返します。

どのステートメントがエラーを生成するか、または警告を生成するかの動作は、現在のsql_modeに大きく影響されます。

概要

ShowErrorsStmt
SHOWERRORSShowLikeOrWhere
ShowLikeOrWhere
LIKESimpleExprWHEREExpression

mysql> select invalid; ERROR 1054 (42S22): Unknown column 'invalid' in 'field list' mysql> create invalid; 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" mysql> SHOW ERRORS; +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | Error | 1054 | Unknown column 'invalid' in 'field list' | | 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" | +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.00 sec) mysql> CREATE invalid2; 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 15 near "invalid2" mysql> SELECT 1; +------+ | 1 | +------+ | 1 | +------+ 1 row in set (0.00 sec) mysql> SHOW ERRORS; Empty set (0.00 sec)

MySQL 互換性

TiDB のSHOW ERRORSステートメントは MySQL と完全に互換性があります。互換性の違いが見つかった場合は、 バグを報告

参照

このページは役に立ちましたか?

Playground
登録なしで TiDB の機能をワンストップでインタラクティブに体験できます。
製品
TiDB Dedicated
TiDB Serverless
TiDB
価格
PoC お問い合わせ
エコシステム
TiKV
TiFlash
OSS Insight
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.