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
a19cb302
Commit
a19cb302
authored
Aug 10, 2009
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Plain Diff
Merge from mysql-5.0-bugteam.
parents
ad624f1d
357430de
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
10 deletions
+58
-10
mysql-test/r/ctype_recoding.result
mysql-test/r/ctype_recoding.result
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+15
-2
sql/sql_lex.cc
sql/sql_lex.cc
+9
-7
tests/mysql_client_test.c
tests/mysql_client_test.c
+33
-0
No files found.
mysql-test/r/ctype_recoding.result
View file @
a19cb302
...
@@ -165,7 +165,7 @@ CREATE TABLE `good
...
@@ -165,7 +165,7 @@ CREATE TABLE `good
ERROR HY000: Invalid utf8 character string: ''
ERROR HY000: Invalid utf8 character string: ''
SET NAMES utf8;
SET NAMES utf8;
CREATE TABLE `good` (a int);
CREATE TABLE `good` (a int);
ERROR HY000: Invalid utf8 character string: '` (a
int)'
ERROR HY000: Invalid utf8 character string: ''
set names latin1;
set names latin1;
create table t1 (a char(10) character set koi8r, b text character set koi8r);
create table t1 (a char(10) character set koi8r, b text character set koi8r);
insert into t1 values ('test','test');
insert into t1 values ('test','test');
...
...
sql/mysqld.cc
View file @
a19cb302
...
@@ -4006,15 +4006,28 @@ default_service_handling(char **argv,
...
@@ -4006,15 +4006,28 @@ default_service_handling(char **argv,
const
char
*
account_name
)
const
char
*
account_name
)
{
{
char
path_and_service
[
FN_REFLEN
+
FN_REFLEN
+
32
],
*
pos
,
*
end
;
char
path_and_service
[
FN_REFLEN
+
FN_REFLEN
+
32
],
*
pos
,
*
end
;
const
char
*
opt_delim
;
end
=
path_and_service
+
sizeof
(
path_and_service
)
-
3
;
end
=
path_and_service
+
sizeof
(
path_and_service
)
-
3
;
/* We have to quote filename if it contains spaces */
/* We have to quote filename if it contains spaces */
pos
=
add_quoted_string
(
path_and_service
,
file_path
,
end
);
pos
=
add_quoted_string
(
path_and_service
,
file_path
,
end
);
if
(
*
extra_opt
)
if
(
*
extra_opt
)
{
{
/* Add (possible quoted) option after file_path */
/*
Add option after file_path. There will be zero or one extra option. It's
assumed to be --defaults-file=file but isn't checked. The variable (not
the option name) should be quoted if it contains a string.
*/
*
pos
++=
' '
;
*
pos
++=
' '
;
pos
=
add_quoted_string
(
pos
,
extra_opt
,
end
);
if
(
opt_delim
=
strchr
(
extra_opt
,
'='
))
{
size_t
length
=
++
opt_delim
-
extra_opt
;
strnmov
(
pos
,
extra_opt
,
length
);
}
else
opt_delim
=
extra_opt
;
pos
=
add_quoted_string
(
pos
,
opt_delim
,
end
);
}
}
/* We must have servicename last */
/* We must have servicename last */
*
pos
++=
' '
;
*
pos
++=
' '
;
...
...
sql/sql_lex.cc
View file @
a19cb302
...
@@ -32,10 +32,10 @@ sys_var_long_ptr trg_new_row_fake_var(0, 0);
...
@@ -32,10 +32,10 @@ sys_var_long_ptr trg_new_row_fake_var(0, 0);
/* Macros to look like lex */
/* Macros to look like lex */
#define yyGet()
*(lip->ptr++
)
#define yyGet()
((uchar)*(lip->ptr++)
)
#define yyGetLast()
lip->ptr[-1]
#define yyGetLast()
((uchar)lip->ptr[-1])
#define yyPeek()
lip->ptr[0]
#define yyPeek()
((uchar)lip->ptr[0])
#define yyPeek2()
lip->ptr[1]
#define yyPeek2()
((uchar)lip->ptr[1])
#define yyUnget() lip->ptr--
#define yyUnget() lip->ptr--
#define yySkip() lip->ptr++
#define yySkip() lip->ptr++
#define yyLength() ((uint) (lip->ptr - lip->tok_start)-1)
#define yyLength() ((uint) (lip->ptr - lip->tok_start)-1)
...
@@ -813,9 +813,11 @@ int MYSQLlex(void *arg, void *yythd)
...
@@ -813,9 +813,11 @@ int MYSQLlex(void *arg, void *yythd)
}
}
}
}
#ifdef USE_MB
#ifdef USE_MB
else
if
(
var_length
<
1
)
else
if
(
use_mb
(
cs
))
break
;
// Error
{
if
((
var_length
=
my_ismbchar
(
cs
,
lip
->
ptr
-
1
,
lip
->
end_of_query
)))
lip
->
ptr
+=
var_length
-
1
;
lip
->
ptr
+=
var_length
-
1
;
}
#endif
#endif
}
}
if
(
double_quotes
)
if
(
double_quotes
)
...
...
tests/mysql_client_test.c
View file @
a19cb302
...
@@ -16647,6 +16647,38 @@ static void test_bug41078(void)
...
@@ -16647,6 +16647,38 @@ static void test_bug41078(void)
DBUG_VOID_RETURN
;
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
;
}
/*
/*
Read and parse arguments and MySQL options from my.cnf
Read and parse arguments and MySQL options from my.cnf
*/
*/
...
@@ -16949,6 +16981,7 @@ static struct my_tests_st my_tests[]= {
...
@@ -16949,6 +16981,7 @@ static struct my_tests_st my_tests[]= {
#endif
#endif
{
"test_bug41078"
,
test_bug41078
},
{
"test_bug41078"
,
test_bug41078
},
{
"test_bug20023"
,
test_bug20023
},
{
"test_bug20023"
,
test_bug20023
},
{
"test_bug45010"
,
test_bug45010
},
{
0
,
0
}
{
0
,
0
}
};
};
...
...
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