Skip to content

Commit

Permalink
generalize ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT
Browse files Browse the repository at this point in the history
make it "query reached <some limit> result may be incomplete"
  • Loading branch information
vuvova committed Jul 3, 2023
1 parent d458136 commit 22e5a5f
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 73 deletions.
1 change: 1 addition & 0 deletions include/mysql.h
Expand Up @@ -148,6 +148,7 @@ typedef unsigned long long my_ulonglong;
#define ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN
#define ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
#define ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS
#define ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT ER_QUERY_RESULT_INCOMPLETE

typedef struct st_mysql_rows {
struct st_mysql_rows *next; /* list of rows */
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/information_schema.result
Expand Up @@ -2228,7 +2228,7 @@ SCHEMA_NAME
SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
Warnings:
Warning 1931 Query execution was interrupted. The query examined at least ### rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 10. The query result may be incomplete
#
# MDEV-24179: AAssertion `m_status == DA_ERROR || m_status == DA_OK ||
# m_status == DA_OK_BULK' failed in Diagnostics_area::message()
Expand Down
124 changes: 62 additions & 62 deletions mysql-test/main/limit_rows_examined.result

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mysql-test/main/subselect4.result
Expand Up @@ -2760,7 +2760,7 @@ from t2 join t1 on
('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 500;
1
Warnings:
Warning 1931 Query execution was interrupted. The query examined at least 3020 rows, which exceeds LIMIT ROWS EXAMINED (500). The query result may be incomplete
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 500. The query result may be incomplete
SET join_cache_level= @save_join_cache_level;
DROP TABLE t1,t2,t3,t4;
#
Expand Down
5 changes: 2 additions & 3 deletions sql/share/errmsg-utf8.txt
Expand Up @@ -8084,9 +8084,8 @@ ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION
ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION
chi "无法修改存储函数或触发器内的@@session.skip_replication"
eng "Cannot modify @@session.skip_replication inside a stored function or trigger"
ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT
chi "查询执行被中断。查询检查至少%llu行,超过限制行(%llu)。查询结果可能是不完整的"
eng "Query execution was interrupted. The query examined at least %llu rows, which exceeds LIMIT ROWS EXAMINED (%llu). The query result may be incomplete"
ER_QUERY_RESULT_INCOMPLETE
eng "Query execution was interrupted. The query exceeded %s %llu. The query result may be incomplete"
ER_NO_SUCH_TABLE_IN_ENGINE 42S02
chi "表'%-.192s.%-.192s'在引擎中不存在"
eng "Table '%-.192s.%-.192s' doesn't exist in engine"
Expand Down
6 changes: 3 additions & 3 deletions sql/sql_select.cc
Expand Up @@ -467,9 +467,9 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
bool saved_abort_on_warning= thd->abort_on_warning;
thd->abort_on_warning= false;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT,
ER_THD(thd, ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT),
thd->accessed_rows_and_keys,
ER_QUERY_RESULT_INCOMPLETE,
ER_THD(thd, ER_QUERY_RESULT_INCOMPLETE),
"LIMIT ROWS EXAMINED",
thd->lex->limit_rows_examined->val_uint());
thd->abort_on_warning= saved_abort_on_warning;
thd->reset_killed();
Expand Down
6 changes: 3 additions & 3 deletions sql/sql_union.cc
Expand Up @@ -1658,9 +1658,9 @@ bool st_select_lex_unit::exec()
the current result.
*/
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT,
ER_THD(thd, ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT),
thd->accessed_rows_and_keys,
ER_QUERY_RESULT_INCOMPLETE,
ER_THD(thd, ER_QUERY_RESULT_INCOMPLETE),
"LIMIT ROWS EXAMINED",
thd->lex->limit_rows_examined->val_uint());
thd->reset_killed();
break;
Expand Down

0 comments on commit 22e5a5f

Please sign in to comment.