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
97e2ec40
Commit
97e2ec40
authored
Feb 26, 2010
by
Andrei Elkin
Browse files
Options
Browse Files
Download
Plain Diff
merging from 5.1 rep to a local branch
parents
57d6b444
04f14347
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
57 additions
and
17 deletions
+57
-17
include/my_sys.h
include/my_sys.h
+1
-1
libmysql/libmysql.c
libmysql/libmysql.c
+1
-0
mysql-test/r/explain.result
mysql-test/r/explain.result
+15
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+2
-2
mysql-test/r/having.result
mysql-test/r/having.result
+1
-1
mysql-test/r/select.result
mysql-test/r/select.result
+5
-5
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+4
-4
mysql-test/r/union.result
mysql-test/r/union.result
+1
-1
mysql-test/t/explain.test
mysql-test/t/explain.test
+12
-0
mysys/charset.c
mysys/charset.c
+5
-0
mysys/my_init.c
mysys/my_init.c
+1
-0
sql/item.cc
sql/item.cc
+8
-3
sql/mysqld.cc
sql/mysqld.cc
+1
-0
No files found.
include/my_sys.h
View file @
97e2ec40
...
@@ -950,7 +950,7 @@ extern my_bool resolve_charset(const char *cs_name,
...
@@ -950,7 +950,7 @@ extern my_bool resolve_charset(const char *cs_name,
extern
my_bool
resolve_collation
(
const
char
*
cl_name
,
extern
my_bool
resolve_collation
(
const
char
*
cl_name
,
CHARSET_INFO
*
default_cl
,
CHARSET_INFO
*
default_cl
,
CHARSET_INFO
**
cl
);
CHARSET_INFO
**
cl
);
extern
void
free_charsets
(
void
);
extern
char
*
get_charsets_dir
(
char
*
buf
);
extern
char
*
get_charsets_dir
(
char
*
buf
);
extern
my_bool
my_charset_same
(
CHARSET_INFO
*
cs1
,
CHARSET_INFO
*
cs2
);
extern
my_bool
my_charset_same
(
CHARSET_INFO
*
cs1
,
CHARSET_INFO
*
cs2
);
extern
my_bool
init_compiled_charsets
(
myf
flags
);
extern
my_bool
init_compiled_charsets
(
myf
flags
);
...
...
libmysql/libmysql.c
View file @
97e2ec40
...
@@ -211,6 +211,7 @@ void STDCALL mysql_server_end()
...
@@ -211,6 +211,7 @@ void STDCALL mysql_server_end()
}
}
else
else
{
{
free_charsets
();
mysql_thread_end
();
mysql_thread_end
();
}
}
...
...
mysql-test/r/explain.result
View file @
97e2ec40
...
@@ -210,4 +210,19 @@ Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP colum
...
@@ -210,4 +210,19 @@ Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP colum
Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
SET SESSION sql_mode=@old_sql_mode;
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
DROP TABLE t1;
#
# Bug#47669: Query showed by EXPLAIN EXTENDED gives different result from original query
#
CREATE TABLE t1 (c int);
INSERT INTO t1 VALUES (NULL);
CREATE TABLE t2 (d int);
INSERT INTO t2 VALUES (NULL), (0);
EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
Note 1003 select (select 1 AS `1` from `test`.`t2` where (`test`.`t2`.`d` = NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
DROP TABLE t1, t2;
End of 5.1 tests.
End of 5.1 tests.
mysql-test/r/func_str.result
View file @
97e2ec40
...
@@ -1307,12 +1307,12 @@ explain extended select encode(f1,'zxcv') as 'enc' from t1;
...
@@ -1307,12 +1307,12 @@ explain extended select encode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select encode(
''
,'zxcv') AS `enc` from `test`.`t1`
Note 1003 select encode(
NULL
,'zxcv') AS `enc` from `test`.`t1`
explain extended select decode(f1,'zxcv') as 'enc' from t1;
explain extended select decode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select decode(
''
,'zxcv') AS `enc` from `test`.`t1`
Note 1003 select decode(
NULL
,'zxcv') AS `enc` from `test`.`t1`
drop table t1;
drop table t1;
create table t1 (a bigint not null)engine=myisam;
create table t1 (a bigint not null)engine=myisam;
insert into t1 set a = 1024*1024*1024*4;
insert into t1 set a = 1024*1024*1024*4;
...
...
mysql-test/r/having.result
View file @
97e2ec40
...
@@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
...
@@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Warnings:
Note 1003 select count(
'0'
) AS `b` from `test`.`t1` where 0 having (`b` >= 0)
Note 1003 select count(
NULL
) AS `b` from `test`.`t1` where 0 having (`b` >= 0)
drop table t1;
drop table t1;
CREATE TABLE t1 (
CREATE TABLE t1 (
raw_id int(10) NOT NULL default '0',
raw_id int(10) NOT NULL default '0',
...
...
mysql-test/r/select.result
View file @
97e2ec40
...
@@ -4050,10 +4050,10 @@ join_0.c1;
...
@@ -4050,10 +4050,10 @@ join_0.c1;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Warnings:
Note 1003 select
'0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0'
Note 1003 select
NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL
SHOW WARNINGS;
SHOW WARNINGS;
Level Code Message
Level Code Message
Note 1003 select
'0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0'
Note 1003 select
NULL AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by NULL,NULL,NULL,NULL,NULL
DROP TABLE t1;
DROP TABLE t1;
SELECT 1 AS ` `;
SELECT 1 AS ` `;
...
@@ -4648,17 +4648,17 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20;
...
@@ -4648,17 +4648,17 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select
'0' AS `a`,'0' AS `b`,'0'
AS `c` from `test`.`t1` where 1
Note 1003 select
NULL AS `a`,NULL AS `b`,NULL
AS `c` from `test`.`t1` where 1
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select
'0' AS `a`,'0' AS `b`,'0'
AS `c` from `test`.`t1` where 1
Note 1003 select
NULL AS `a`,NULL AS `b`,NULL
AS `c` from `test`.`t1` where 1
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20;
id select_type table type possible_keys key key_len ref rows filtered Extra
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select
'0' AS `a`,'0' AS `b`,'0'
AS `c` from `test`.`t1` where 1
Note 1003 select
NULL AS `a`,NULL AS `b`,NULL
AS `c` from `test`.`t1` where 1
DROP TABLE t1;
DROP TABLE t1;
#
#
# Bug#45266: Uninitialized variable lead to an empty result.
# Bug#45266: Uninitialized variable lead to an empty result.
...
...
mysql-test/r/subselect.result
View file @
97e2ec40
...
@@ -1496,7 +1496,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -1496,7 +1496,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max(
'0'
) from `test`.`t2`)))
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max(
NULL
) from `test`.`t2`)))
select * from t3 where a >= some (select b from t2);
select * from t3 where a >= some (select b from t2);
a
a
explain extended select * from t3 where a >= some (select b from t2);
explain extended select * from t3 where a >= some (select b from t2);
...
@@ -1504,7 +1504,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -1504,7 +1504,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min(
'0'
) from `test`.`t2`)))
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min(
NULL
) from `test`.`t2`)))
select * from t3 where a >= all (select b from t2 group by 1);
select * from t3 where a >= all (select b from t2 group by 1);
a
a
6
6
...
@@ -1515,7 +1515,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -1515,7 +1515,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select
'0'
AS `b` from `test`.`t2` group by 1)))
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select
NULL
AS `b` from `test`.`t2` group by 1)))
select * from t3 where a >= some (select b from t2 group by 1);
select * from t3 where a >= some (select b from t2 group by 1);
a
a
explain extended select * from t3 where a >= some (select b from t2 group by 1);
explain extended select * from t3 where a >= some (select b from t2 group by 1);
...
@@ -1523,7 +1523,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -1523,7 +1523,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found
Warnings:
Warnings:
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select
'0'
AS `b` from `test`.`t2` group by 1)))
Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select
NULL
AS `b` from `test`.`t2` group by 1)))
select * from t3 where NULL >= any (select b from t2);
select * from t3 where NULL >= any (select b from t2);
a
a
explain extended select * from t3 where NULL >= any (select b from t2);
explain extended select * from t3 where NULL >= any (select b from t2);
...
...
mysql-test/r/union.result
View file @
97e2ec40
...
@@ -1585,7 +1585,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -1585,7 +1585,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 UNION t1 system NULL NULL NULL NULL 0 0.00 const row not found
2 UNION t1 system NULL NULL NULL NULL 0 0.00 const row not found
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL NULL Using filesort
Warnings:
Warnings:
Note 1003 select
'0' AS `a` from `test`.`t1` union select '0'
AS `a` from `test`.`t1` order by `a`
Note 1003 select
NULL AS `a` from `test`.`t1` union select NULL
AS `a` from `test`.`t1` order by `a`
DROP TABLE t1;
DROP TABLE t1;
End of 5.0 tests
End of 5.0 tests
#
#
...
...
mysql-test/t/explain.test
View file @
97e2ec40
...
@@ -187,4 +187,16 @@ SET SESSION sql_mode=@old_sql_mode;
...
@@ -187,4 +187,16 @@ SET SESSION sql_mode=@old_sql_mode;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#47669: Query showed by EXPLAIN EXTENDED gives different result from original query
--
echo
#
CREATE
TABLE
t1
(
c
int
);
INSERT
INTO
t1
VALUES
(
NULL
);
CREATE
TABLE
t2
(
d
int
);
INSERT
INTO
t2
VALUES
(
NULL
),
(
0
);
EXPLAIN
EXTENDED
SELECT
(
SELECT
1
FROM
t2
WHERE
d
=
c
)
FROM
t1
;
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.1
tests
.
--
echo
End
of
5.1
tests
.
mysys/charset.c
View file @
97e2ec40
...
@@ -427,6 +427,11 @@ static void init_available_charsets(void)
...
@@ -427,6 +427,11 @@ static void init_available_charsets(void)
}
}
void
free_charsets
(
void
)
{
charsets_initialized
=
MY_PTHREAD_ONCE_INIT
;
}
uint
get_collation_number
(
const
char
*
name
)
uint
get_collation_number
(
const
char
*
name
)
{
{
my_pthread_once
(
&
charsets_initialized
,
init_available_charsets
);
my_pthread_once
(
&
charsets_initialized
,
init_available_charsets
);
...
...
mysys/my_init.c
View file @
97e2ec40
...
@@ -165,6 +165,7 @@ void my_end(int infoflag)
...
@@ -165,6 +165,7 @@ void my_end(int infoflag)
my_print_open_files
();
my_print_open_files
();
}
}
}
}
free_charsets
();
my_error_unregister_all
();
my_error_unregister_all
();
my_once_free
();
my_once_free
();
...
...
sql/item.cc
View file @
97e2ec40
...
@@ -5690,9 +5690,14 @@ void Item_field::print(String *str, enum_query_type query_type)
...
@@ -5690,9 +5690,14 @@ void Item_field::print(String *str, enum_query_type query_type)
char
buff
[
MAX_FIELD_WIDTH
];
char
buff
[
MAX_FIELD_WIDTH
];
String
tmp
(
buff
,
sizeof
(
buff
),
str
->
charset
());
String
tmp
(
buff
,
sizeof
(
buff
),
str
->
charset
());
field
->
val_str
(
&
tmp
);
field
->
val_str
(
&
tmp
);
str
->
append
(
'\''
);
if
(
field
->
is_null
())
str
->
append
(
tmp
);
str
->
append
(
"NULL"
);
str
->
append
(
'\''
);
else
{
str
->
append
(
'\''
);
str
->
append
(
tmp
);
str
->
append
(
'\''
);
}
return
;
return
;
}
}
Item_ident
::
print
(
str
,
query_type
);
Item_ident
::
print
(
str
,
query_type
);
...
...
sql/mysqld.cc
View file @
97e2ec40
...
@@ -1287,6 +1287,7 @@ void clean_up(bool print_message)
...
@@ -1287,6 +1287,7 @@ void clean_up(bool print_message)
lex_free
();
/* Free some memory */
lex_free
();
/* Free some memory */
item_create_cleanup
();
item_create_cleanup
();
set_var_free
();
set_var_free
();
free_charsets
();
if
(
!
opt_noacl
)
if
(
!
opt_noacl
)
{
{
#ifdef HAVE_DLOPEN
#ifdef HAVE_DLOPEN
...
...
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