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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4b379778
Commit
4b379778
authored
Oct 15, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-sub-4.1
parents
f125849d
8141b058
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
sql/sql_parse.cc
sql/sql_parse.cc
+27
-9
No files found.
sql/sql_parse.cc
View file @
4b379778
...
...
@@ -2005,6 +2005,7 @@ mysql_execute_command(THD *thd)
CHARSET_INFO
*
to_cs
=
thd
->
variables
.
collation_connection
;
bool
need_conversion
;
user_var_entry
*
entry
;
String
*
pstr
=
&
str
;
uint32
unused
;
/*
Convert @var contents to string in connection character set. Although
...
...
@@ -2020,26 +2021,43 @@ mysql_execute_command(THD *thd)
String
*
pstr
;
my_bool
is_var_null
;
pstr
=
entry
->
val_str
(
&
is_var_null
,
&
str
,
NOT_FIXED_DEC
);
/*
NULL value of variable checked early as entry->value so here
we can't get NULL in normal conditions
*/
DBUG_ASSERT
(
!
is_var_null
);
if
(
!
pstr
)
send_error
(
thd
,
ER_OUT_OF_RESOURCES
);
DBUG_ASSERT
(
pstr
==
&
str
);
{
res
=
-
1
;
break
;
// EOM (error should be reported by allocator)
}
}
else
{
/*
variable absent or equal to NULL, so we need to set variable to
something reasonable to get readable error message during parsing
*/
str
.
set
(
"NULL"
,
4
,
&
my_charset_latin1
);
}
need_conversion
=
String
::
needs_conversion
(
str
.
length
(),
str
.
charset
(),
to_cs
,
&
unused
);
String
::
needs_conversion
(
pstr
->
length
(),
pstr
->
charset
(),
to_cs
,
&
unused
);
query_len
=
need_conversion
?
(
str
.
length
()
*
to_cs
->
mbmaxlen
)
:
str
.
length
();
query_len
=
need_conversion
?
(
pstr
->
length
()
*
to_cs
->
mbmaxlen
)
:
pstr
->
length
();
if
(
!
(
query_str
=
alloc_root
(
&
thd
->
mem_root
,
query_len
+
1
)))
send_error
(
thd
,
ER_OUT_OF_RESOURCES
);
{
res
=
-
1
;
break
;
// EOM (error should be reported by allocator)
}
if
(
need_conversion
)
query_len
=
copy_and_convert
(
query_str
,
query_len
,
to_cs
,
str
.
ptr
(),
str
.
length
(),
str
.
charset
());
query_len
=
copy_and_convert
(
query_str
,
query_len
,
to_cs
,
pstr
->
ptr
(),
pstr
->
length
(),
pstr
->
charset
());
else
memcpy
(
query_str
,
str
.
ptr
(),
str
.
length
());
memcpy
(
query_str
,
pstr
->
ptr
(),
pstr
->
length
());
query_str
[
query_len
]
=
0
;
}
else
...
...
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