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
b2b9485a
Commit
b2b9485a
authored
May 17, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jimw/my/mysql-5.0-10251
into mysql.com:/home/jimw/my/mysql-5.0-clean
parents
390e0bbc
ff2d0938
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
40 deletions
+37
-40
client/mysqltest.c
client/mysqltest.c
+22
-40
mysql-test/r/mysqltest.result
mysql-test/r/mysqltest.result
+6
-0
mysql-test/t/mysqltest.test
mysql-test/t/mysqltest.test
+9
-0
No files found.
client/mysqltest.c
View file @
b2b9485a
...
...
@@ -2024,11 +2024,11 @@ my_bool end_of_query(int c)
int
read_line
(
char
*
buf
,
int
size
)
{
int
c
;
char
quote
;
char
*
p
=
buf
,
*
buf_end
=
buf
+
size
-
1
;
int
no_save
=
0
;
enum
{
R_NORMAL
,
R_Q1
,
R_ESC_Q_Q1
,
R_ESC_Q_Q2
,
R_ESC_SLASH_Q1
,
R_ESC_SLASH_Q2
,
R_Q2
,
R_COMMENT
,
R_LINE_START
}
state
=
R_LINE_START
;
enum
{
R_NORMAL
,
R_Q
,
R_Q_IN_Q
,
R_SLASH_IN_Q
,
R_COMMENT
,
R_LINE_START
}
state
=
R_LINE_START
;
DBUG_ENTER
(
"read_line"
);
start_lineno
=
*
lineno
;
...
...
@@ -2063,10 +2063,11 @@ int read_line(char* buf, int size)
*
p
=
0
;
DBUG_RETURN
(
0
);
}
else
if
(
c
==
'\''
)
state
=
R_Q1
;
else
if
(
c
==
'"'
)
state
=
R_Q2
;
else
if
(
c
==
'\''
||
c
==
'"'
||
c
==
'`'
)
{
quote
=
c
;
state
=
R_Q
;
}
else
if
(
c
==
'\n'
)
{
state
=
R_LINE_START
;
...
...
@@ -2101,55 +2102,36 @@ int read_line(char* buf, int size)
*
p
=
0
;
DBUG_RETURN
(
0
);
}
else
if
(
c
==
'\''
)
state
=
R_Q1
;
else
if
(
c
==
'"'
)
state
=
R_Q2
;
else
state
=
R_NORMAL
;
break
;
case
R_Q1
:
if
(
c
==
'\''
)
state
=
R_ESC_Q_Q1
;
else
if
(
c
==
'\\'
)
state
=
R_ESC_SLASH_Q1
;
break
;
case
R_ESC_Q_Q1
:
if
(
end_of_query
(
c
))
else
if
(
c
==
'\''
||
c
==
'"'
||
c
==
'`'
)
{
*
p
=
0
;
DBUG_RETURN
(
0
)
;
quote
=
c
;
state
=
R_Q
;
}
if
(
c
!=
'\''
)
state
=
R_NORMAL
;
else
state
=
R_Q1
;
break
;
case
R_ESC_SLASH_Q1
:
state
=
R_Q1
;
state
=
R_NORMAL
;
break
;
case
R_Q
2
:
if
(
c
==
'"'
)
state
=
R_
ESC_Q_Q2
;
case
R_Q
:
if
(
c
==
quote
)
state
=
R_
Q_IN_Q
;
else
if
(
c
==
'\\'
)
state
=
R_
ESC_SLASH_Q2
;
state
=
R_
SLASH_IN_Q
;
break
;
case
R_
ESC_Q_Q2
:
case
R_
Q_IN_Q
:
if
(
end_of_query
(
c
))
{
*
p
=
0
;
DBUG_RETURN
(
0
);
}
if
(
c
!=
'"'
)
if
(
c
!=
quote
)
state
=
R_NORMAL
;
else
state
=
R_Q
2
;
state
=
R_Q
;
break
;
case
R_
ESC_SLASH_Q2
:
state
=
R_Q
2
;
case
R_
SLASH_IN_Q
:
state
=
R_Q
;
break
;
}
if
(
!
no_save
)
...
...
mysql-test/r/mysqltest.result
View file @
b2b9485a
...
...
@@ -142,3 +142,9 @@ after_--enable_abort_on_error
1064
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
select 1 as `a'b`, 2 as `a"b`;
a'b a"b
1 2
select 'aaa\\','aa''a',"aa""a";
aaa\ aa'a aa"a
aaa\ aa'a aa"a
mysql-test/t/mysqltest.test
View file @
b2b9485a
...
...
@@ -286,3 +286,12 @@ select 3 from t1 ;
#select 3 from t1 ;
#
#select 3 from t1 ;
#
# Bug #10251: Identifiers containing quotes not handled correctly
#
select
1
as
`a'b`
,
2
as
`a"b`
;
# Test escaping of quotes
select
'aaa\\'
,
'aa''a'
,
"aa""a"
;
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