summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-06-07 14:11:36 +0400
committerkonstantin@mysql.com <>2005-06-07 14:11:36 +0400
commit9f379d7f05c43b2d09de91c3af5cc35613a745e4 (patch)
treed2686d80a3486e1912b96a6e6774bd3f77da0022 /sql/sql_error.cc
parent7288ef873f3168bf54d84967223e469dcf68fdf3 (diff)
downloadmariadb-git-9f379d7f05c43b2d09de91c3af5cc35613a745e4.tar.gz
Patch two (the final one) for Bug#7306 "the server side preparedStatement
error for LIMIT placeholder". The patch adds grammar support for LIMIT ?, ? and changes the type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*, so that it can point to Item_param.
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r--sql/sql_error.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 3bda16202b9..8a12339ccee 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -225,20 +225,22 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
MYSQL_ERROR *err;
SELECT_LEX *sel= &thd->lex->select_lex;
- ha_rows offset= sel->offset_limit, limit= sel->select_limit;
+ SELECT_LEX_UNIT *unit= &thd->lex->unit;
+ ha_rows idx= 0;
Protocol *protocol=thd->protocol;
-
+
+ unit->set_limit(sel);
+
List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
while ((err= it++))
{
/* Skip levels that the user is not interested in */
if (!(levels_to_show & ((ulong) 1 << err->level)))
continue;
- if (offset)
- {
- offset--;
+ if (++idx <= unit->offset_limit_cnt)
continue;
- }
+ if (idx > unit->select_limit_cnt)
+ break;
protocol->prepare_for_resend();
protocol->store(warning_level_names[err->level],
warning_level_length[err->level], system_charset_info);
@@ -246,8 +248,6 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
protocol->store(err->msg, strlen(err->msg), system_charset_info);
if (protocol->write())
DBUG_RETURN(TRUE);
- if (!--limit)
- break;
}
send_eof(thd);
DBUG_RETURN(FALSE);