mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user