diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/lex.h | 2 | ||||
-rw-r--r-- | sql/sql_class.cc | 3 | ||||
-rw-r--r-- | sql/sql_error.cc | 8 | ||||
-rw-r--r-- | sql/sql_error.h | 11 |
4 files changed, 16 insertions, 8 deletions
diff --git a/sql/lex.h b/sql/lex.h index 4ce88ccc2ee..1ae577328ee 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -567,6 +567,8 @@ SYMBOL symbols[] = { { "ROWS", SYM(ROWS_SYM)}, { "ROWTYPE", SYM(ROWTYPE_MARIADB_SYM)}, { "ROW_COUNT", SYM(ROW_COUNT_SYM)}, + /** sql_function and condition_property_name for GET DIAGNOSTICS */ + { "ROW_NUMBER", SYM(ROW_NUMBER_SYM)}, { "ROW_FORMAT", SYM(ROW_FORMAT_SYM)}, /** sql_function and condition_property_name for GET DIAGNOSTICS */ { "ROW_NUMBER", SYM(ROW_NUMBER_SYM)}, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 31f5faa72ed..4d7093763ae 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1149,7 +1149,8 @@ Sql_condition* THD::raise_condition(uint sql_errno, if (likely(!(is_fatal_error && (sql_errno == EE_OUTOFMEMORY || sql_errno == ER_OUTOFMEMORY)))) { - cond= da->push_warning(this, sql_errno, sqlstate, level, ucid, msg); + cond= da->push_warning(this, sql_errno, sqlstate, level, ucid, msg, + da->current_row_for_warning()); } DBUG_RETURN(cond); } diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 7b6e6a83d2f..a2178831697 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -663,7 +663,8 @@ void Warning_info::reserve_space(THD *thd, uint count) Sql_condition *Warning_info::push_warning(THD *thd, const Sql_condition_identity *value, - const char *msg) + const char *msg, + ulong current_row_number) { Sql_condition *cond= NULL; @@ -673,7 +674,7 @@ Sql_condition *Warning_info::push_warning(THD *thd, m_warn_list.elements() < thd->variables.max_error_count) { cond= new (& m_warn_root) Sql_condition(& m_warn_root, *value, msg, - m_current_row_for_warning); + current_row_number); if (cond) m_warn_list.push_back(cond); } @@ -689,7 +690,8 @@ Sql_condition *Warning_info::push_warning(THD *thd, const Sql_condition *sql_condition) { Sql_condition *new_condition= push_warning(thd, sql_condition, - sql_condition->get_message_text()); + sql_condition->get_message_text(), + sql_condition->m_row_number); if (new_condition) new_condition->copy_opt_attributes(sql_condition); diff --git a/sql/sql_error.h b/sql/sql_error.h index e7f1a27a6a7..ae33a53f80d 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -748,7 +748,8 @@ private: */ Sql_condition *push_warning(THD *thd, const Sql_condition_identity *identity, - const char* msg); + const char* msg, + ulong current_row_number); /** Add a new SQL-condition to the current list and increment the respective @@ -1179,10 +1180,12 @@ public: const char* sqlstate, Sql_condition::enum_warning_level level, const Sql_user_condition_identity &ucid, - const char* msg) + const char* msg, + ulong current_row_number) { Sql_condition_identity tmp(sql_errno_arg, sqlstate, level, ucid); - return get_warning_info()->push_warning(thd, &tmp, msg); + return get_warning_info()->push_warning(thd, &tmp, msg, + current_row_number); } Sql_condition *push_warning(THD *thd, @@ -1192,7 +1195,7 @@ public: const char* msg) { return push_warning(thd, sqlerrno, sqlstate, level, - Sql_user_condition_identity(), msg); + Sql_user_condition_identity(), msg, 0); } void mark_sql_conditions_for_removal() { get_warning_info()->mark_sql_conditions_for_removal(); } |