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
660355c1
Commit
660355c1
authored
Nov 02, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: Item_func_get_system_var::print()
parent
96bb5f44
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
5 deletions
+46
-5
mysql-test/r/variables.result
mysql-test/r/variables.result
+20
-0
mysql-test/t/variables.test
mysql-test/t/variables.test
+8
-0
sql/item_func.cc
sql/item_func.cc
+16
-1
sql/sql_string.h
sql/sql_string.h
+2
-4
No files found.
mysql-test/r/variables.result
View file @
660355c1
...
@@ -1801,3 +1801,23 @@ select * from information_schema.session_variables where variable_name='sql_mode
...
@@ -1801,3 +1801,23 @@ select * from information_schema.session_variables where variable_name='sql_mode
VARIABLE_NAME VARIABLE_VALUE
VARIABLE_NAME VARIABLE_VALUE
SQL_MODE ANSI_QUOTES
SQL_MODE ANSI_QUOTES
End of 5.5 tests
End of 5.5 tests
explain extended select @@VERsion from dual where rand() > @@verSION;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select @@VERsion AS "@@VERsion" from DUAL where (rand() > @@version)
explain extended select @@SESsion.SQL_mode from dual where rand() > @@sesSION.sql_MODE;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select @@SESsion.SQL_mode AS "@@SESsion.SQL_mode" from DUAL where (rand() > @@sql_mode)
explain extended select @@GLObal.COLLATION_connection from dual where rand() > @@gloBAL.collation_CONNECTION;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select @@GLObal.COLLATION_connection AS "@@GLObal.COLLATION_connection" from DUAL where (rand() > @@global.collation_connection)
explain extended select @@FOObar.KEY_BUFfer_size from dual where rand() > @@fooBAR.key_bufFER_SIZE;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select @@FOObar.KEY_BUFfer_size AS "@@FOObar.KEY_BUFfer_size" from DUAL where (rand() > @@fooBAR.key_buffer_size)
mysql-test/t/variables.test
View file @
660355c1
...
@@ -1532,3 +1532,11 @@ show global status like 'foobar';
...
@@ -1532,3 +1532,11 @@ show global status like 'foobar';
select
*
from
information_schema
.
session_variables
where
variable_name
=
'sql_mode'
;
select
*
from
information_schema
.
session_variables
where
variable_name
=
'sql_mode'
;
--
echo
End
of
5.5
tests
--
echo
End
of
5.5
tests
#
# test Item_func_get_system_var::print()
#
explain
extended
select
@@
VERsion
from
dual
where
rand
()
>
@@
verSION
;
explain
extended
select
@@
SESsion
.
SQL_mode
from
dual
where
rand
()
>
@@
sesSION
.
sql_MODE
;
explain
extended
select
@@
GLObal
.
COLLATION_connection
from
dual
where
rand
()
>
@@
gloBAL
.
collation_CONNECTION
;
explain
extended
select
@@
FOObar
.
KEY_BUFfer_size
from
dual
where
rand
()
>
@@
fooBAR
.
key_bufFER_SIZE
;
sql/item_func.cc
View file @
660355c1
...
@@ -5841,7 +5841,22 @@ void Item_func_get_system_var::fix_length_and_dec()
...
@@ -5841,7 +5841,22 @@ void Item_func_get_system_var::fix_length_and_dec()
void
Item_func_get_system_var
::
print
(
String
*
str
,
enum_query_type
query_type
)
void
Item_func_get_system_var
::
print
(
String
*
str
,
enum_query_type
query_type
)
{
{
str
->
append
(
name
,
name_length
);
if
(
name_length
)
str
->
append
(
name
,
name_length
);
else
{
str
->
append
(
STRING_WITH_LEN
(
"@@"
));
if
(
component
.
length
)
{
str
->
append
(
&
component
);
str
->
append
(
'.'
);
}
else
if
(
var_type
==
SHOW_OPT_GLOBAL
&&
var
->
scope
()
!=
sys_var
::
GLOBAL
)
{
str
->
append
(
STRING_WITH_LEN
(
"global."
));
}
str
->
append
(
&
var
->
name
);
}
}
}
bool
Item_func_get_system_var
::
check_vcol_func_processor
(
void
*
arg
)
bool
Item_func_get_system_var
::
check_vcol_func_processor
(
void
*
arg
)
...
...
sql/sql_string.h
View file @
660355c1
...
@@ -466,10 +466,8 @@ class String
...
@@ -466,10 +466,8 @@ class String
}
}
bool
append
(
const
String
&
s
);
bool
append
(
const
String
&
s
);
bool
append
(
const
char
*
s
);
bool
append
(
const
char
*
s
);
bool
append
(
const
LEX_STRING
*
ls
)
bool
append
(
const
LEX_STRING
*
ls
)
{
return
append
(
ls
->
str
,
ls
->
length
);
}
{
bool
append
(
const
LEX_CSTRING
*
ls
)
{
return
append
(
ls
->
str
,
ls
->
length
);
}
return
append
(
ls
->
str
,
ls
->
length
);
}
bool
append
(
const
char
*
s
,
uint32
arg_length
);
bool
append
(
const
char
*
s
,
uint32
arg_length
);
bool
append
(
const
char
*
s
,
uint32
arg_length
,
CHARSET_INFO
*
cs
);
bool
append
(
const
char
*
s
,
uint32
arg_length
,
CHARSET_INFO
*
cs
);
bool
append_ulonglong
(
ulonglong
val
);
bool
append_ulonglong
(
ulonglong
val
);
...
...
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