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
e8fec66e
Commit
e8fec66e
authored
May 29, 2007
by
malff/marcsql@weblab.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual merge
parent
cb4316e3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
6 deletions
+75
-6
sql/sp_head.cc
sql/sp_head.cc
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+6
-3
sql/sql_lex.h
sql/sql_lex.h
+2
-1
sql/sql_view.cc
sql/sql_view.cc
+1
-1
tests/mysql_client_test.c
tests/mysql_client_test.c
+65
-0
No files found.
sql/sp_head.cc
View file @
e8fec66e
...
@@ -571,7 +571,7 @@ sp_head::init_strings(THD *thd, LEX *lex)
...
@@ -571,7 +571,7 @@ sp_head::init_strings(THD *thd, LEX *lex)
Trim "garbage" at the end. This is sometimes needed with the
Trim "garbage" at the end. This is sometimes needed with the
"/ * ! VERSION... * /" wrapper in dump files.
"/ * ! VERSION... * /" wrapper in dump files.
*/
*/
endp
=
skip_rear_comments
(
m_body_begin
,
endp
);
endp
=
skip_rear_comments
(
thd
->
charset
(),
m_body_begin
,
endp
);
m_body
.
length
=
endp
-
m_body_begin
;
m_body
.
length
=
endp
-
m_body_begin
;
m_body
.
str
=
strmake_root
(
root
,
m_body_begin
,
m_body
.
length
);
m_body
.
str
=
strmake_root
(
root
,
m_body_begin
,
m_body
.
length
);
...
...
sql/sql_lex.cc
View file @
e8fec66e
...
@@ -1151,6 +1151,7 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
...
@@ -1151,6 +1151,7 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
SYNOPSIS
SYNOPSIS
skip_rear_comments()
skip_rear_comments()
cs character set
begin pointer to the beginning of statement
begin pointer to the beginning of statement
end pointer to the end of statement
end pointer to the end of statement
...
@@ -1161,10 +1162,12 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
...
@@ -1161,10 +1162,12 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
Pointer to the last non-comment symbol of the statement.
Pointer to the last non-comment symbol of the statement.
*/
*/
const
char
*
skip_rear_comments
(
const
char
*
begin
,
const
char
*
end
)
const
char
*
skip_rear_comments
(
CHARSET_INFO
*
cs
,
const
char
*
begin
,
const
char
*
end
)
{
{
while
(
begin
<
end
&&
(
end
[
-
1
]
<=
' '
||
end
[
-
1
]
==
'*'
||
while
(
begin
<
end
&&
(
end
[
-
1
]
==
'*'
||
end
[
-
1
]
==
'/'
||
end
[
-
1
]
==
';'
))
end
[
-
1
]
==
'/'
||
end
[
-
1
]
==
';'
||
my_isspace
(
cs
,
end
[
-
1
])))
end
-=
1
;
end
-=
1
;
return
end
;
return
end
;
}
}
...
...
sql/sql_lex.h
View file @
e8fec66e
...
@@ -1417,7 +1417,8 @@ extern void lex_free(void);
...
@@ -1417,7 +1417,8 @@ extern void lex_free(void);
extern
void
lex_start
(
THD
*
thd
);
extern
void
lex_start
(
THD
*
thd
);
extern
void
lex_end
(
LEX
*
lex
);
extern
void
lex_end
(
LEX
*
lex
);
extern
int
MYSQLlex
(
void
*
arg
,
void
*
yythd
);
extern
int
MYSQLlex
(
void
*
arg
,
void
*
yythd
);
extern
const
char
*
skip_rear_comments
(
const
char
*
ubegin
,
const
char
*
uend
);
extern
const
char
*
skip_rear_comments
(
CHARSET_INFO
*
cs
,
const
char
*
ubegin
,
const
char
*
uend
);
extern
bool
is_lex_native_function
(
const
LEX_STRING
*
name
);
extern
bool
is_lex_native_function
(
const
LEX_STRING
*
name
);
...
...
sql/sql_view.cc
View file @
e8fec66e
...
@@ -775,7 +775,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
...
@@ -775,7 +775,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view
->
query
.
length
=
str
.
length
()
-
1
;
// we do not need last \0
view
->
query
.
length
=
str
.
length
()
-
1
;
// we do not need last \0
view
->
source
.
str
=
thd
->
query
+
thd
->
lex
->
create_view_select_start
;
view
->
source
.
str
=
thd
->
query
+
thd
->
lex
->
create_view_select_start
;
endp
=
view
->
source
.
str
;
endp
=
view
->
source
.
str
;
endp
=
skip_rear_comments
(
endp
,
thd
->
query
+
thd
->
query_length
);
endp
=
skip_rear_comments
(
thd
->
charset
(),
endp
,
thd
->
query
+
thd
->
query_length
);
view
->
source
.
length
=
endp
-
view
->
source
.
str
;
view
->
source
.
length
=
endp
-
view
->
source
.
str
;
view
->
file_version
=
1
;
view
->
file_version
=
1
;
view
->
calc_md5
(
md5
);
view
->
calc_md5
(
md5
);
...
...
tests/mysql_client_test.c
View file @
e8fec66e
...
@@ -16097,6 +16097,70 @@ static void test_bug28075()
...
@@ -16097,6 +16097,70 @@ static void test_bug28075()
}
}
#endif
#endif
/*
Bug#27876 (SF with cyrillic variable name fails during execution (regression))
*/
static
void
test_bug27876
()
{
int
rc
;
MYSQL_RES
*
result
;
char
utf8_func
[]
=
{
0xd1
,
0x84
,
0xd1
,
0x83
,
0xd0
,
0xbd
,
0xd0
,
0xba
,
0xd1
,
0x86
,
0xd0
,
0xb8
,
0xd0
,
0xb9
,
0xd0
,
0xba
,
0xd0
,
0xb0
,
0x00
};
char
utf8_param
[]
=
{
0xd0
,
0xbf
,
0xd0
,
0xb0
,
0xd1
,
0x80
,
0xd0
,
0xb0
,
0xd0
,
0xbc
,
0xd0
,
0xb5
,
0xd1
,
0x82
,
0xd1
,
0x8a
,
0xd1
,
0x80
,
0x5f
,
0xd0
,
0xb2
,
0xd0
,
0xb5
,
0xd1
,
0x80
,
0xd1
,
0x81
,
0xd0
,
0xb8
,
0xd1
,
0x8f
,
0x00
};
char
query
[
500
];
DBUG_ENTER
(
"test_bug27876"
);
myheader
(
"test_bug27876"
);
rc
=
mysql_query
(
mysql
,
"set names utf8"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"select version()"
);
myquery
(
rc
);
result
=
mysql_store_result
(
mysql
);
mytest
(
result
);
sprintf
(
query
,
"DROP FUNCTION IF EXISTS %s"
,
utf8_func
);
rc
=
mysql_query
(
mysql
,
query
);
myquery
(
rc
);
sprintf
(
query
,
"CREATE FUNCTION %s( %s VARCHAR(25))"
" RETURNS VARCHAR(25) DETERMINISTIC RETURN %s"
,
utf8_func
,
utf8_param
,
utf8_param
);
rc
=
mysql_query
(
mysql
,
query
);
myquery
(
rc
);
sprintf
(
query
,
"SELECT %s(VERSION())"
,
utf8_func
);
rc
=
mysql_query
(
mysql
,
query
);
myquery
(
rc
);
result
=
mysql_store_result
(
mysql
);
mytest
(
result
);
sprintf
(
query
,
"DROP FUNCTION %s"
,
utf8_func
);
rc
=
mysql_query
(
mysql
,
query
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"set names default"
);
myquery
(
rc
);
}
/*
/*
Read and parse arguments and MySQL options from my.cnf
Read and parse arguments and MySQL options from my.cnf
*/
*/
...
@@ -16384,6 +16448,7 @@ static struct my_tests_st my_tests[]= {
...
@@ -16384,6 +16448,7 @@ static struct my_tests_st my_tests[]= {
#ifdef fix_bug_in_pb_first
#ifdef fix_bug_in_pb_first
{
"test_bug28075"
,
test_bug28075
},
{
"test_bug28075"
,
test_bug28075
},
#endif
#endif
{
"test_bug27876"
,
test_bug27876
},
{
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