Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d6ed8ccb
Commit
d6ed8ccb
authored
Aug 10, 2009
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge.
parents
4cf3621d
357430de
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
8 deletions
+40
-8
mysql-test/r/ctype_recoding.result
mysql-test/r/ctype_recoding.result
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+6
-3
sql/sql_lex.h
sql/sql_lex.h
+4
-4
tests/mysql_client_test.c
tests/mysql_client_test.c
+29
-0
No files found.
mysql-test/r/ctype_recoding.result
View file @
d6ed8ccb
...
...
@@ -165,7 +165,7 @@ CREATE TABLE `good
ERROR HY000: Invalid utf8 character string: ''
SET NAMES utf8;
CREATE TABLE `good` (a int);
ERROR HY000: Invalid utf8 character string: '` (a
int)'
ERROR HY000: Invalid utf8 character string: ''
set names latin1;
create table t1 (a char(10) character set koi8r, b text character set koi8r);
insert into t1 values ('test','test');
...
...
sql/sql_lex.cc
View file @
d6ed8ccb
...
...
@@ -1105,9 +1105,12 @@ int MYSQLlex(void *arg, void *yythd)
}
}
#ifdef USE_MB
else
if
(
var_length
<
1
)
break
;
// Error
lip
->
skip_binary
(
var_length
-
1
);
else
if
(
use_mb
(
cs
))
{
if
((
var_length
=
my_ismbchar
(
cs
,
lip
->
get_ptr
()
-
1
,
lip
->
get_end_of_query
())))
lip
->
skip_binary
(
var_length
-
1
);
}
#endif
}
if
(
double_quotes
)
...
...
sql/sql_lex.h
View file @
d6ed8ccb
...
...
@@ -1190,7 +1190,7 @@ class Lex_input_stream
Get a character, and advance in the stream.
@return the next character to parse.
*/
char
yyGet
()
unsigned
char
yyGet
()
{
char
c
=
*
m_ptr
++
;
if
(
m_echo
)
...
...
@@ -1202,7 +1202,7 @@ class Lex_input_stream
Get the last character accepted.
@return the last character accepted.
*/
char
yyGetLast
()
unsigned
char
yyGetLast
()
{
return
m_ptr
[
-
1
];
}
...
...
@@ -1210,7 +1210,7 @@ class Lex_input_stream
/**
Look at the next character to parse, but do not accept it.
*/
char
yyPeek
()
unsigned
char
yyPeek
()
{
return
m_ptr
[
0
];
}
...
...
@@ -1219,7 +1219,7 @@ class Lex_input_stream
Look ahead at some character to parse.
@param n offset of the character to look up
*/
char
yyPeekn
(
int
n
)
unsigned
char
yyPeekn
(
int
n
)
{
return
m_ptr
[
n
];
}
...
...
tests/mysql_client_test.c
View file @
d6ed8ccb
...
...
@@ -17947,6 +17947,34 @@ static void test_bug41078(void)
DBUG_VOID_RETURN
;
}
/**
Bug#45010: invalid memory reads during parsing some strange statements
*/
static
void
test_bug45010
()
{
int
rc
;
const
char
query1
[]
=
"select a.
\x80
"
,
query2
[]
=
"describe `table
\xef
"
;
DBUG_ENTER
(
"test_bug45010"
);
myheader
(
"test_bug45010"
);
rc
=
mysql_query
(
mysql
,
"set names utf8"
);
myquery
(
rc
);
/* \x80 (-128) could be used as a index of ident_map. */
rc
=
mysql_real_query
(
mysql
,
query1
,
sizeof
(
query1
)
-
1
);
DIE_UNLESS
(
rc
);
/* \xef (-17) could be used to skip 3 bytes past the buffer end. */
rc
=
mysql_real_query
(
mysql
,
query2
,
sizeof
(
query2
)
-
1
);
DIE_UNLESS
(
rc
);
rc
=
mysql_query
(
mysql
,
"set names default"
);
myquery
(
rc
);
DBUG_VOID_RETURN
;
}
/**
Bug#44495: Prepared Statement:
...
...
@@ -18301,6 +18329,7 @@ static struct my_tests_st my_tests[]= {
{
"test_change_user"
,
test_change_user
},
{
"test_bug30472"
,
test_bug30472
},
{
"test_bug20023"
,
test_bug20023
},
{
"test_bug45010"
,
test_bug45010
},
{
"test_bug31418"
,
test_bug31418
},
{
"test_bug31669"
,
test_bug31669
},
{
"test_bug28386"
,
test_bug28386
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment