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
4b3a345b
Commit
4b3a345b
authored
Nov 10, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/home/bar/mysql-4.1
parents
7d09ee39
c5e6941e
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
181 additions
and
17 deletions
+181
-17
mysql-test/r/metadata.result
mysql-test/r/metadata.result
+1
-1
mysql-test/r/null.result
mysql-test/r/null.result
+94
-0
mysql-test/r/ps_2myisam.result
mysql-test/r/ps_2myisam.result
+2
-2
mysql-test/r/ps_3innodb.result
mysql-test/r/ps_3innodb.result
+2
-2
mysql-test/r/ps_4heap.result
mysql-test/r/ps_4heap.result
+2
-2
mysql-test/r/ps_5merge.result
mysql-test/r/ps_5merge.result
+4
-4
mysql-test/r/ps_6bdb.result
mysql-test/r/ps_6bdb.result
+2
-2
mysql-test/r/ps_7ndb.result
mysql-test/r/ps_7ndb.result
+2
-2
mysql-test/t/null.test
mysql-test/t/null.test
+67
-0
sql/item.cc
sql/item.cc
+2
-2
sql/item.h
sql/item.h
+3
-0
No files found.
mysql-test/r/metadata.result
View file @
4b3a345b
...
...
@@ -5,7 +5,7 @@ def 1 8 1 1 N 32769 0 8
def 1.0 5 3 3 N 32769 1 8
def -1 8 1 2 N 32769 0 8
def hello 254 5 5 N 1 31 8
def NULL 6 0 0 Y 32
768 0 8
def NULL 6 0 0 Y 32
896 0 63
1 1.0 -1 hello NULL
1 1.0 -1 hello NULL
create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
...
...
mysql-test/r/null.result
View file @
4b3a345b
...
...
@@ -175,3 +175,97 @@ explain select * from t1 where i=2 or i is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i i 4 const 7 Using where; Using index
drop table t1;
set names latin2;
create table t1 select
null as c00,
if(1, null, 'string') as c01,
if(0, null, 'string') as c02,
ifnull(null, 'string') as c03,
ifnull('string', null) as c04,
case when 0 then null else 'string' end as c05,
case when 1 then null else 'string' end as c06,
coalesce(null, 'string') as c07,
coalesce('string', null) as c08,
least('string',null) as c09,
least(null, 'string') as c10,
greatest('string',null) as c11,
greatest(null, 'string') as c12,
nullif('string', null) as c13,
nullif(null, 'string') as c14,
trim('string' from null) as c15,
trim(null from 'string') as c16,
substring_index('string', null, 1) as c17,
substring_index(null, 'string', 1) as c18,
elt(1, null, 'string') as c19,
elt(1, 'string', null) as c20,
concat('string', null) as c21,
concat(null, 'string') as c22,
concat_ws('sep', 'string', null) as c23,
concat_ws('sep', null, 'string') as c24,
concat_ws(null, 'string', 'string') as c25,
make_set(3, 'string', null) as c26,
make_set(3, null, 'string') as c27,
export_set(3, null, 'off', 'sep') as c29,
export_set(3, 'on', null, 'sep') as c30,
export_set(3, 'on', 'off', null) as c31,
replace(null, 'from', 'to') as c32,
replace('str', null, 'to') as c33,
replace('str', 'from', null) as c34,
insert('str', 1, 2, null) as c35,
insert(null, 1, 2, 'str') as c36,
lpad('str', 10, null) as c37,
rpad(null, 10, 'str') as c38;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c00` binary(0) default NULL,
`c01` varchar(6) character set latin2 default NULL,
`c02` varchar(6) character set latin2 default NULL,
`c03` varchar(6) character set latin2 NOT NULL default '',
`c04` varchar(6) character set latin2 default NULL,
`c05` varchar(6) character set latin2 default NULL,
`c06` varchar(6) character set latin2 default NULL,
`c07` varchar(6) character set latin2 default NULL,
`c08` varchar(6) character set latin2 default NULL,
`c09` varchar(6) character set latin2 NOT NULL default '',
`c10` varchar(6) character set latin2 NOT NULL default '',
`c11` varchar(6) character set latin2 NOT NULL default '',
`c12` varchar(6) character set latin2 NOT NULL default '',
`c13` varchar(6) character set latin2 default NULL,
`c14` char(0) character set latin2 default NULL,
`c15` char(0) character set latin2 default NULL,
`c16` varchar(6) character set latin2 default NULL,
`c17` varchar(6) character set latin2 default NULL,
`c18` char(0) character set latin2 default NULL,
`c19` varchar(6) character set latin2 default NULL,
`c20` varchar(6) character set latin2 default NULL,
`c21` varchar(6) character set latin2 default NULL,
`c22` varchar(6) character set latin2 default NULL,
`c23` varchar(9) character set latin2 default NULL,
`c24` varchar(9) character set latin2 default NULL,
`c25` varchar(12) character set latin2 default NULL,
`c26` varchar(7) character set latin2 default NULL,
`c27` varchar(7) character set latin2 default NULL,
`c29` longtext character set latin2,
`c30` longtext character set latin2,
`c31` varchar(192) character set latin2 default NULL,
`c32` char(0) character set latin2 default NULL,
`c33` char(3) character set latin2 default NULL,
`c34` char(3) character set latin2 default NULL,
`c35` char(3) character set latin2 default NULL,
`c36` char(3) character set latin2 default NULL,
`c37` varchar(10) character set latin2 default NULL,
`c38` varchar(10) character set latin2 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
case 'str' when 'STR' then 'str' when null then 'null' end as c01,
case 'str' when null then 'null' when 'STR' then 'str' end as c02,
field(null, 'str1', 'str2') as c03,
field('str1','STR1', null) as c04,
field('str1', null, 'STR1') as c05,
'string' in ('STRING', null) as c08,
'string' in (null, 'STRING') as c09;
c01 c02 c03 c04 c05 c08 c09
str str 0 1 2 1 1
set names latin1;
mysql-test/r/ps_2myisam.result
View file @
4b3a345b
...
...
@@ -1790,7 +1790,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
`const12`
char
(0) default NULL,
`const12`
binary
(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
...
...
@@ -1820,7 +1820,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y
0 0 8
def test t5 t5 const12 const12 254 0 0 Y
128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
...
...
mysql-test/r/ps_3innodb.result
View file @
4b3a345b
...
...
@@ -1773,7 +1773,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
`const12`
char
(0) default NULL,
`const12`
binary
(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
...
...
@@ -1803,7 +1803,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y
0 0 8
def test t5 t5 const12 const12 254 0 0 Y
128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
...
...
mysql-test/r/ps_4heap.result
View file @
4b3a345b
...
...
@@ -1774,7 +1774,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
`const12`
char
(0) default NULL,
`const12`
binary
(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
...
...
@@ -1804,7 +1804,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y
0 0 8
def test t5 t5 const12 const12 254 0 0 Y
128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
...
...
mysql-test/r/ps_5merge.result
View file @
4b3a345b
...
...
@@ -1713,7 +1713,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
`const12`
char
(0) default NULL,
`const12`
binary
(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
...
...
@@ -1743,7 +1743,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y
0 0 8
def test t5 t5 const12 const12 254 0 0 Y
128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
...
...
@@ -4723,7 +4723,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
`const12`
char
(0) default NULL,
`const12`
binary
(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
...
...
@@ -4753,7 +4753,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y
0 0 8
def test t5 t5 const12 const12 254 0 0 Y
128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
...
...
mysql-test/r/ps_6bdb.result
View file @
4b3a345b
...
...
@@ -1773,7 +1773,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
`const12`
char
(0) default NULL,
`const12`
binary
(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
...
...
@@ -1803,7 +1803,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y
0 0 8
def test t5 t5 const12 const12 254 0 0 Y
128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
...
...
mysql-test/r/ps_7ndb.result
View file @
4b3a345b
...
...
@@ -1749,7 +1749,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL,
`const11` int(4) default NULL,
`param11` bigint(20) default NULL,
`const12`
char
(0) default NULL,
`const12`
binary
(0) default NULL,
`param12` bigint(20) default NULL,
`param13` double default NULL,
`param14` longtext,
...
...
@@ -1779,7 +1779,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y
0 0 8
def test t5 t5 const12 const12 254 0 0 Y
128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
...
...
mysql-test/t/null.test
View file @
4b3a345b
...
...
@@ -119,3 +119,70 @@ alter table t1 change i i int not null;
explain
select
*
from
t1
where
i
=
2
or
i
is
null
;
drop
table
t1
;
#
# NULL has its own type BINARY(0) by default.
# But NULL should be weaker than a constant
# when mixing charsets/collations
#
set
names
latin2
;
# Check that result type is taken from a non-null string
create
table
t1
select
null
as
c00
,
if
(
1
,
null
,
'string'
)
as
c01
,
if
(
0
,
null
,
'string'
)
as
c02
,
ifnull
(
null
,
'string'
)
as
c03
,
ifnull
(
'string'
,
null
)
as
c04
,
case
when
0
then
null
else
'string'
end
as
c05
,
case
when
1
then
null
else
'string'
end
as
c06
,
coalesce
(
null
,
'string'
)
as
c07
,
coalesce
(
'string'
,
null
)
as
c08
,
least
(
'string'
,
null
)
as
c09
,
least
(
null
,
'string'
)
as
c10
,
greatest
(
'string'
,
null
)
as
c11
,
greatest
(
null
,
'string'
)
as
c12
,
nullif
(
'string'
,
null
)
as
c13
,
nullif
(
null
,
'string'
)
as
c14
,
trim
(
'string'
from
null
)
as
c15
,
trim
(
null
from
'string'
)
as
c16
,
substring_index
(
'string'
,
null
,
1
)
as
c17
,
substring_index
(
null
,
'string'
,
1
)
as
c18
,
elt
(
1
,
null
,
'string'
)
as
c19
,
elt
(
1
,
'string'
,
null
)
as
c20
,
concat
(
'string'
,
null
)
as
c21
,
concat
(
null
,
'string'
)
as
c22
,
concat_ws
(
'sep'
,
'string'
,
null
)
as
c23
,
concat_ws
(
'sep'
,
null
,
'string'
)
as
c24
,
concat_ws
(
null
,
'string'
,
'string'
)
as
c25
,
make_set
(
3
,
'string'
,
null
)
as
c26
,
make_set
(
3
,
null
,
'string'
)
as
c27
,
export_set
(
3
,
null
,
'off'
,
'sep'
)
as
c29
,
export_set
(
3
,
'on'
,
null
,
'sep'
)
as
c30
,
export_set
(
3
,
'on'
,
'off'
,
null
)
as
c31
,
replace
(
null
,
'from'
,
'to'
)
as
c32
,
replace
(
'str'
,
null
,
'to'
)
as
c33
,
replace
(
'str'
,
'from'
,
null
)
as
c34
,
insert
(
'str'
,
1
,
2
,
null
)
as
c35
,
insert
(
null
,
1
,
2
,
'str'
)
as
c36
,
lpad
(
'str'
,
10
,
null
)
as
c37
,
rpad
(
null
,
10
,
'str'
)
as
c38
;
show
create
table
t1
;
drop
table
t1
;
#
# Check that comparison is done according to
# non-null string collation, i.e. case insensitively,
# rather than according to NULL's collation, i.e. case sensitively
#
--
in
field
select
case
'str'
when
'STR'
then
'str'
when
null
then
'null'
end
as
c01
,
case
'str'
when
null
then
'null'
when
'STR'
then
'str'
end
as
c02
,
field
(
null
,
'str1'
,
'str2'
)
as
c03
,
field
(
'str1'
,
'STR1'
,
null
)
as
c04
,
field
(
'str1'
,
null
,
'STR1'
)
as
c05
,
'string'
in
(
'STRING'
,
null
)
as
c08
,
'string'
in
(
null
,
'STRING'
)
as
c09
;
# Restore charset to the default value.
set
names
latin1
;
sql/item.cc
View file @
4b3a345b
...
...
@@ -376,13 +376,13 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags)
}
else
if
((
flags
&
MY_COLL_ALLOW_COERCIBLE_CONV
)
&&
derivation
<
dt
.
derivation
&&
dt
.
derivation
=
=
DERIVATION_COERCIBLE
)
dt
.
derivation
>
=
DERIVATION_COERCIBLE
)
{
// Do nothing;
}
else
if
((
flags
&
MY_COLL_ALLOW_COERCIBLE_CONV
)
&&
dt
.
derivation
<
derivation
&&
derivation
=
=
DERIVATION_COERCIBLE
)
derivation
>
=
DERIVATION_COERCIBLE
)
{
set
(
dt
);
strong
=
nagg
;
...
...
sql/item.h
View file @
4b3a345b
...
...
@@ -31,6 +31,7 @@ void item_init(void); /* Init item functions */
enum
Derivation
{
DERIVATION_IGNORABLE
=
4
,
DERIVATION_COERCIBLE
=
3
,
DERIVATION_IMPLICIT
=
2
,
DERIVATION_NONE
=
1
,
...
...
@@ -98,6 +99,7 @@ class DTCollation {
{
switch
(
derivation
)
{
case
DERIVATION_IGNORABLE
:
return
"IGNORABLE"
;
case
DERIVATION_COERCIBLE
:
return
"COERCIBLE"
;
case
DERIVATION_IMPLICIT
:
return
"IMPLICIT"
;
case
DERIVATION_EXPLICIT
:
return
"EXPLICIT"
;
...
...
@@ -440,6 +442,7 @@ class Item_null :public Item
max_length
=
0
;
name
=
name_par
?
name_par
:
(
char
*
)
"NULL"
;
fixed
=
1
;
collation
.
set
(
&
my_charset_bin
,
DERIVATION_IGNORABLE
);
}
enum
Type
type
()
const
{
return
NULL_ITEM
;
}
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
...
...
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