-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-12783 : sql_mode=ORACLE: Functions LENGTH() and LENGTHB()
- Loading branch information
halfspawn
committed
May 18, 2017
1 parent
5b034f1
commit 87d9527
Showing
5 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters