mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-14269 errors.test fails with valgrind (Conditional jump or move depends on uninitialised value)
This commit is contained in:
parent
3ab112eb39
commit
7a63a7dc6d
3 changed files with 42 additions and 7 deletions
|
@ -174,3 +174,11 @@ set max_session_mem_used = 50000;
|
|||
select * from seq_1_to_1000;
|
||||
set max_session_mem_used = 8192;
|
||||
select * from seq_1_to_1000;
|
||||
#
|
||||
# MDEV-14269 errors.test fails with valgrind (Conditional jump or move depends on uninitialised value)
|
||||
#
|
||||
SET NAMES utf8;
|
||||
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
|
||||
ERROR 22003: BIGINT value is out of range in '-73 * -2465717823867977728'
|
||||
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.long_query_time,null);
|
||||
ERROR 22003: BIGINT value is out of range in '-73 * -2465717823867977728'
|
||||
|
|
|
@ -213,3 +213,14 @@ select * from seq_1_to_1000;
|
|||
--enable_result_log
|
||||
# We may not be able to execute any more queries with this connection
|
||||
# because of too little memory#
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-14269 errors.test fails with valgrind (Conditional jump or move depends on uninitialised value)
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8;
|
||||
--error ER_DATA_OUT_OF_RANGE
|
||||
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
|
||||
--error ER_DATA_OUT_OF_RANGE
|
||||
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.long_query_time,null);
|
||||
|
|
|
@ -2464,6 +2464,21 @@ static int my_xpath_parse_UnaryExpr(MY_XPATH *xpath)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
A helper class to make a null-terminated string from XPath fragments.
|
||||
The string is allocated on the THD memory root.
|
||||
*/
|
||||
class XPath_cstring_null_terminated: public LEX_CSTRING
|
||||
{
|
||||
public:
|
||||
XPath_cstring_null_terminated(THD *thd, const char *str, size_t length)
|
||||
{
|
||||
if (thd->make_lex_string(this, str, length))
|
||||
static_cast<LEX_CSTRING>(*this)= empty_clex_str;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Scan Number
|
||||
|
||||
|
@ -2498,14 +2513,15 @@ static int my_xpath_parse_Number(MY_XPATH *xpath)
|
|||
thd= xpath->thd;
|
||||
if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_DOT))
|
||||
{
|
||||
xpath->item= new (thd->mem_root) Item_int(thd, xpath->prevtok.beg,
|
||||
(uint)(xpath->prevtok.end - xpath->prevtok.beg));
|
||||
return 1;
|
||||
XPath_cstring_null_terminated nr(thd, beg, xpath->prevtok.end - beg);
|
||||
xpath->item= new (thd->mem_root) Item_int(thd, nr.str, (uint) nr.length);
|
||||
}
|
||||
else
|
||||
{
|
||||
my_xpath_parse_term(xpath, MY_XPATH_LEX_DIGITS);
|
||||
XPath_cstring_null_terminated nr(thd, beg, xpath->prevtok.end - beg);
|
||||
xpath->item= new (thd->mem_root) Item_float(thd, nr.str, (uint) nr.length);
|
||||
}
|
||||
my_xpath_parse_term(xpath, MY_XPATH_LEX_DIGITS);
|
||||
|
||||
xpath->item= new (thd->mem_root) Item_float(thd, beg,
|
||||
(uint)(xpath->prevtok.end - beg));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue