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
732cfaba
Commit
732cfaba
authored
May 18, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'halfspawn-bb-10.2-ext' into bb-10.2-ext
parents
5b034f1c
87d95274
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
2 deletions
+56
-2
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+11
-0
mysql-test/suite/compat/oracle/r/func_length.result
mysql-test/suite/compat/oracle/r/func_length.result
+21
-0
mysql-test/suite/compat/oracle/t/func_length.test
mysql-test/suite/compat/oracle/t/func_length.test
+18
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+5
-0
sql/item_create.cc
sql/item_create.cc
+1
-2
No files found.
mysql-test/r/func_str.result
View file @
732cfaba
...
...
@@ -4876,5 +4876,16 @@ IF(a<' ',HEX(a),a)
a
DROP TABLE t1;
#
# MDEV-12783 sql_mode=ORACLE: Functions LENGTH() and LENGTHB()
#
SELECT LENGTHB('a'), LENGTHB(_utf8 0xC39F), LENGTHB(123), LENGTH(null);
LENGTHB('a') LENGTHB(_utf8 0xC39F) LENGTHB(123) LENGTH(null)
1 2 3 NULL
EXPLAIN EXTENDED SELECT LENGTH('a'), LENGTHB('a');
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 octet_length('a') AS `LENGTH('a')`,octet_length('a') AS `LENGTHB('a')`
#
# End of 10.3 tests
#
mysql-test/suite/compat/oracle/r/func_length.result
0 → 100644
View file @
732cfaba
SET sql_mode=ORACLE;
#
# MDEV-12783 sql_mode=ORACLE: Functions LENGTH() and LENGTHB()
#
SELECT LENGTH(null), LENGTH('a'), LENGTH(123);
LENGTH(null) LENGTH('a') LENGTH(123)
NULL 1 3
SELECT LENGTHB(null), LENGTHB('a'), LENGTHB(123);
LENGTHB(null) LENGTHB('a') LENGTHB(123)
NULL 1 3
SELECT LENGTH(_utf8 0xC39F), LENGTH(CHAR(14844588 USING utf8));
LENGTH(_utf8 0xC39F) LENGTH(CHAR(14844588 USING utf8))
1 1
SELECT LENGTHB(_utf8 0xC39F), LENGTHB(CHAR(14844588 USING utf8));
LENGTHB(_utf8 0xC39F) LENGTHB(CHAR(14844588 USING utf8))
2 3
EXPLAIN EXTENDED SELECT LENGTH('a'), LENGTHB('a');
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 char_length('a') AS "LENGTH('a')",octet_length('a') AS "LENGTHB('a')"
mysql-test/suite/compat/oracle/t/func_length.test
0 → 100644
View file @
732cfaba
SET
sql_mode
=
ORACLE
;
--
echo
#
--
echo
# MDEV-12783 sql_mode=ORACLE: Functions LENGTH() and LENGTHB()
--
echo
#
#
# Testing LENGTH / LENGTHB
#
# LENGTH : return the length of char
# LENGTHB : return the length of byte
SELECT
LENGTH
(
null
),
LENGTH
(
'a'
),
LENGTH
(
123
);
SELECT
LENGTHB
(
null
),
LENGTHB
(
'a'
),
LENGTHB
(
123
);
SELECT
LENGTH
(
_utf8
0xC39F
),
LENGTH
(
CHAR
(
14844588
USING
utf8
));
SELECT
LENGTHB
(
_utf8
0xC39F
),
LENGTHB
(
CHAR
(
14844588
USING
utf8
));
EXPLAIN
EXTENDED
SELECT
LENGTH
(
'a'
),
LENGTHB
(
'a'
);
mysql-test/t/func_str.test
View file @
732cfaba
...
...
@@ -1883,6 +1883,11 @@ INSERT INTO t1 VALUES (0x09),('a');
SELECT
IF
(
a
<
' '
,
HEX
(
a
),
a
)
FROM
t1
ORDER
BY
a
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-12783 sql_mode=ORACLE: Functions LENGTH() and LENGTHB()
--
echo
#
SELECT
LENGTHB
(
'a'
),
LENGTHB
(
_utf8
0xC39F
),
LENGTHB
(
123
),
LENGTH
(
null
);
EXPLAIN
EXTENDED
SELECT
LENGTH
(
'a'
),
LENGTHB
(
'a'
);
--
echo
#
--
echo
# End of 10.3 tests
...
...
sql/item_create.cc
View file @
732cfaba
...
...
@@ -5684,11 +5684,9 @@ Create_func_length Create_func_length::s_singleton;
Item
*
Create_func_length
::
create_1_arg
(
THD
*
thd
,
Item
*
arg1
)
{
#if 0 // Not yet
if
(
thd
->
variables
.
sql_mode
&
MODE_ORACLE
)
return
new
(
thd
->
mem_root
)
Item_func_char_length
(
thd
,
arg1
);
else
#endif
return
new
(
thd
->
mem_root
)
Item_func_octet_length
(
thd
,
arg1
);
}
...
...
@@ -6978,6 +6976,7 @@ static Native_func_registry func_array[] =
{
{
C_STRING_WITH_LEN
(
"LCASE"
)
},
BUILDER
(
Create_func_lcase
)},
{
{
C_STRING_WITH_LEN
(
"LEAST"
)
},
BUILDER
(
Create_func_least
)},
{
{
C_STRING_WITH_LEN
(
"LENGTH"
)
},
BUILDER
(
Create_func_length
)},
{
{
C_STRING_WITH_LEN
(
"LENGTHB"
)
},
BUILDER
(
Create_func_octet_length
)},
#ifndef DBUG_OFF
{
{
C_STRING_WITH_LEN
(
"LIKE_RANGE_MIN"
)
},
BUILDER
(
Create_func_like_range_min
)},
{
{
C_STRING_WITH_LEN
(
"LIKE_RANGE_MAX"
)
},
BUILDER
(
Create_func_like_range_max
)},
...
...
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