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
3a43a2e2
Commit
3a43a2e2
authored
Sep 28, 2010
by
Vasil Dimov
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql-5.5-bugfixing -> mysql-5.5-innodb
parents
f661c09d
6a707718
Changes
47
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
466 additions
and
203 deletions
+466
-203
dbug/dbug.c
dbug/dbug.c
+1
-5
include/mysql/service_my_snprintf.h
include/mysql/service_my_snprintf.h
+1
-1
mysql-test/include/default_mysqld.cnf
mysql-test/include/default_mysqld.cnf
+6
-0
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+2
-0
mysql-test/r/parser.result
mysql-test/r/parser.result
+4
-0
mysql-test/r/select.result
mysql-test/r/select.result
+6
-6
mysql-test/r/strict.result
mysql-test/r/strict.result
+15
-12
mysql-test/r/type_datetime.result
mysql-test/r/type_datetime.result
+25
-0
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+12
-0
mysql-test/suite/perfschema/include/upgrade_check.inc
mysql-test/suite/perfschema/include/upgrade_check.inc
+1
-1
mysql-test/suite/perfschema/r/checksum.result
mysql-test/suite/perfschema/r/checksum.result
+34
-0
mysql-test/suite/perfschema/r/server_init.result
mysql-test/suite/perfschema/r/server_init.result
+3
-15
mysql-test/suite/perfschema/r/start_server_no_cond_class.result
...test/suite/perfschema/r/start_server_no_cond_class.result
+4
-4
mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
...-test/suite/perfschema/r/start_server_no_cond_inst.result
+4
-4
mysql-test/suite/perfschema/r/start_server_no_file_class.result
...test/suite/perfschema/r/start_server_no_file_class.result
+4
-4
mysql-test/suite/perfschema/r/start_server_no_file_inst.result
...-test/suite/perfschema/r/start_server_no_file_inst.result
+4
-4
mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
...est/suite/perfschema/r/start_server_no_mutex_class.result
+4
-4
mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
...test/suite/perfschema/r/start_server_no_mutex_inst.result
+3
-3
mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
...st/suite/perfschema/r/start_server_no_rwlock_class.result
+4
-4
mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
...est/suite/perfschema/r/start_server_no_rwlock_inst.result
+3
-3
mysql-test/suite/perfschema/r/start_server_no_thread_class.result
...st/suite/perfschema/r/start_server_no_thread_class.result
+4
-4
mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
...est/suite/perfschema/r/start_server_no_thread_inst.result
+4
-4
mysql-test/suite/perfschema/r/start_server_off.result
mysql-test/suite/perfschema/r/start_server_off.result
+4
-4
mysql-test/suite/perfschema/r/start_server_on.result
mysql-test/suite/perfschema/r/start_server_on.result
+4
-4
mysql-test/suite/perfschema/t/checksum.test
mysql-test/suite/perfschema/t/checksum.test
+64
-0
mysql-test/suite/perfschema/t/server_init.test
mysql-test/suite/perfschema/t/server_init.test
+17
-59
mysql-test/t/strict.test
mysql-test/t/strict.test
+12
-12
mysql-test/t/type_datetime.test
mysql-test/t/type_datetime.test
+23
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+9
-0
mysql-test/valgrind.supp
mysql-test/valgrind.supp
+35
-0
mysys/my_gethwaddr.c
mysys/my_gethwaddr.c
+1
-1
mysys/my_sync.c
mysys/my_sync.c
+14
-7
sql/field.cc
sql/field.cc
+3
-2
sql/item_timefunc.cc
sql/item_timefunc.cc
+34
-1
sql/item_timefunc.h
sql/item_timefunc.h
+3
-0
sql/log.cc
sql/log.cc
+1
-4
sql/log.h
sql/log.h
+1
-0
sql/mysqld.cc
sql/mysqld.cc
+20
-12
sql/set_var.h
sql/set_var.h
+3
-0
sql/sql_plugin.cc
sql/sql_plugin.cc
+1
-1
sql/sql_repl.cc
sql/sql_repl.cc
+13
-3
storage/perfschema/ha_perfschema.cc
storage/perfschema/ha_perfschema.cc
+12
-0
storage/perfschema/pfs_engine_table.cc
storage/perfschema/pfs_engine_table.cc
+12
-0
storage/perfschema/table_events_waits.cc
storage/perfschema/table_events_waits.cc
+13
-7
storage/perfschema/table_events_waits.h
storage/perfschema/table_events_waits.h
+1
-1
strings/my_vsnprintf.c
strings/my_vsnprintf.c
+8
-6
unittest/mysys/my_vsnprintf-t.c
unittest/mysys/my_vsnprintf-t.c
+10
-1
No files found.
dbug/dbug.c
View file @
3a43a2e2
...
@@ -1335,15 +1335,11 @@ void _db_doprnt_(const char *format,...)
...
@@ -1335,15 +1335,11 @@ void _db_doprnt_(const char *format,...)
* This function is intended as a
* This function is intended as a
* vfprintf clone with consistent, platform independent output for
* vfprintf clone with consistent, platform independent output for
* problematic formats like %p, %zd and %lld.
* problematic formats like %p, %zd and %lld.
* However: full functionality for my_vsnprintf has not been backported yet,
* so code using "%g" or "%f" will have undefined behaviour.
*/
*/
static
void
DbugVfprintf
(
FILE
*
stream
,
const
char
*
format
,
va_list
args
)
static
void
DbugVfprintf
(
FILE
*
stream
,
const
char
*
format
,
va_list
args
)
{
{
char
cvtbuf
[
1024
];
char
cvtbuf
[
1024
];
size_t
len
;
(
void
)
my_vsnprintf
(
cvtbuf
,
sizeof
(
cvtbuf
),
format
,
args
);
/* Do not use my_vsnprintf, it does not support "%g". */
len
=
vsnprintf
(
cvtbuf
,
sizeof
(
cvtbuf
),
format
,
args
);
(
void
)
fprintf
(
stream
,
"%s
\n
"
,
cvtbuf
);
(
void
)
fprintf
(
stream
,
"%s
\n
"
,
cvtbuf
);
}
}
...
...
include/mysql/service_my_snprintf.h
View file @
3a43a2e2
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<length modifier> can be 'l', 'll', or 'z'.
<length modifier> can be 'l', 'll', or 'z'.
Supported formats are 's' (null pointer is accepted, printed as
Supported formats are 's' (null pointer is accepted, printed as
"(null)"), 'b' (extension, see below), 'c', 'd', 'u', 'x', 'o',
"(null)"), 'b' (extension, see below), 'c', 'd', '
i', '
u', 'x', 'o',
'X', 'p' (works as 0x%x).
'X', 'p' (works as 0x%x).
Standard syntax for positional arguments $n is supported.
Standard syntax for positional arguments $n is supported.
...
...
mysql-test/include/default_mysqld.cnf
View file @
3a43a2e2
...
@@ -43,5 +43,11 @@ log-bin=mysqld-bin
...
@@ -43,5 +43,11 @@ log-bin=mysqld-bin
# Run tests with the performance schema instrumentation
# Run tests with the performance schema instrumentation
loose-enable-performance-schema
loose-enable-performance-schema
# Run tests with a small number of instrumented objects
# to limit memory consumption with MTR
loose-performance-schema-max-mutex-instances=10000
loose-performance-schema-max-rwlock-instances=10000
loose-performance-schema-max-table-instances=500
loose-performance-schema-max-table-handles=1000
binlog-direct-non-transactional-updates
binlog-direct-non-transactional-updates
mysql-test/r/func_time.result
View file @
3a43a2e2
...
@@ -1200,6 +1200,8 @@ set time_zone= @@global.time_zone;
...
@@ -1200,6 +1200,8 @@ set time_zone= @@global.time_zone;
select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
select str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
str_to_date('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
NULL
NULL
Warnings:
Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date
create table t1 (field DATE);
create table t1 (field DATE);
insert into t1 values ('2006-11-06');
insert into t1 values ('2006-11-06');
select * from t1 where field < '2006-11-06 04:08:36.0';
select * from t1 where field < '2006-11-06 04:08:36.0';
...
...
mysql-test/r/parser.result
View file @
3a43a2e2
...
@@ -556,9 +556,13 @@ DROP TABLE IF EXISTS t1;
...
@@ -556,9 +556,13 @@ DROP TABLE IF EXISTS t1;
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
NULL
NULL
Warnings:
Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE
NULL
NULL
Warnings:
Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
"1997-12-31 23:59:59" + INTERVAL 1 SECOND
"1997-12-31 23:59:59" + INTERVAL 1 SECOND
1998-01-01 00:00:00
1998-01-01 00:00:00
...
...
mysql-test/r/select.result
View file @
3a43a2e2
...
@@ -4171,9 +4171,10 @@ str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
...
@@ -4171,9 +4171,10 @@ str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00'
set SQL_MODE=TRADITIONAL;
set SQL_MODE=TRADITIONAL;
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
0
NULL
Warnings:
Warnings:
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date
select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';
str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'
0
0
...
@@ -4181,17 +4182,16 @@ Warnings:
...
@@ -4181,17 +4182,16 @@ Warnings:
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
Warning 1292 Truncated incorrect datetime value: '2007-10-00 12:34'
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34';
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'
0
NULL
Warnings:
Warnings:
Warning 1
292 Truncated incorrect datetime value: '2007-10-00 12:34:00'
Warning 1
411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date
select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
and '2007/10/20';
and '2007/10/20';
str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01'
and '2007/10/20'
and '2007/10/20'
0
NULL
Warnings:
Warnings:
Warning 1292 Incorrect datetime value: '2007-10-00' for column '2007/09/01' at row 1
Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date
Warning 1292 Incorrect datetime value: '2007-10-00' for column '2007/10/20' at row 1
set SQL_MODE=DEFAULT;
set SQL_MODE=DEFAULT;
select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20';
str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'
str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'
...
...
mysql-test/r/strict.result
View file @
3a43a2e2
...
@@ -206,12 +206,11 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y'));
...
@@ -206,12 +206,11 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y'));
INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
Warnings:
ERROR HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date
Note 1265 Data truncated for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR
22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1
ERROR
HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
ERROR
22007: Incorrect date value: '2004-10-00 15:30:00' for column 'col1' at row 1
ERROR
HY000: Incorrect datetime value: '0.10.2004 15.30' for function str_to_date
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect date value: '2004-09-31 15:30:00' for column 'col1' at row 1
ERROR 22007: Incorrect date value: '2004-09-31 15:30:00' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
...
@@ -221,12 +220,13 @@ ERROR 22007: Incorrect date value: '2003-02-29 15:30:00' for column 'col1' at ro
...
@@ -221,12 +220,13 @@ ERROR 22007: Incorrect date value: '2003-02-29 15:30:00' for column 'col1' at ro
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR
22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
ERROR
HY000: Incorrect datetime value: '00.00.0000' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
ERROR HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR
22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col2' at row 1
ERROR
HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
ERROR
22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
ERROR
HY000: Incorrect datetime value: '0.10.2004 15.30' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col2' at row 1
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
...
@@ -236,13 +236,13 @@ ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col2' a
...
@@ -236,13 +236,13 @@ ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col2' a
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR
22007: Incorrect datetime value: '0000-00-00' for column 'col2' at row 1
ERROR
HY000: Incorrect datetime value: '00.00.0000' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
ERROR
22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
ERROR
HY000: Incorrect datetime value: '31.10.0000 15.30' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR
22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col3' at row 1
ERROR
HY000: Incorrect datetime value: '31.0.2004 15.30' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
ERROR
22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
ERROR
HY000: Incorrect datetime value: '0.10.2004 15.30' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col3' at row 1
ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col3' at row 1
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
...
@@ -252,7 +252,7 @@ ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col3' a
...
@@ -252,7 +252,7 @@ ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col3' a
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i'));
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
INSERT INTO t1 (col3) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR
22007: Incorrect datetime value: '0000-00-00' for column 'col3' at row 1
ERROR
HY000: Incorrect datetime value: '00.00.0000' for function str_to_date
drop table t1;
drop table t1;
CREATE TABLE t1 (col1 date, col2 datetime, col3 timestamp);
CREATE TABLE t1 (col1 date, col2 datetime, col3 timestamp);
INSERT INTO t1 (col1) VALUES (CAST('2004-10-15' AS DATE));
INSERT INTO t1 (col1) VALUES (CAST('2004-10-15' AS DATE));
...
@@ -1108,6 +1108,9 @@ Warnings:
...
@@ -1108,6 +1108,9 @@ Warnings:
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
drop table t1;
drop table t1;
create table t1 (col1 char(3), col2 integer);
create table t1 (col1 char(3), col2 integer);
insert into t1 (col1) values (cast(1000 as char(3)));
insert into t1 (col1) values (cast(1000 as char(3)));
...
...
mysql-test/r/type_datetime.result
View file @
3a43a2e2
...
@@ -655,5 +655,30 @@ Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from
...
@@ -655,5 +655,30 @@ Note 1003 select `test`.`t1`.`Id` AS `Id`,`test`.`t1`.`AtTime` AS `AtTime` from
DROP TABLE t1;
DROP TABLE t1;
SET NAMES latin1;
SET NAMES latin1;
#
#
# Bug#56271: Wrong comparison result with STR_TO_DATE function
#
CREATE TABLE t1 (
`year` int(4) NOT NULL,
`month` int(2) NOT NULL
);
INSERT INTO t1 VALUES (2010,3),(2010,4),(2009,8),(2008,9);
SELECT *
FROM t1
WHERE STR_TO_DATE(CONCAT_WS('/01/',`month`,`year`), '%m/%d/%Y') >=
STR_TO_DATE('1/1/2010', '%m/%d/%Y');
year month
2010 3
2010 4
create table t2(f1 datetime primary key);
insert into t2 select STR_TO_DATE(CONCAT_WS('/01/',`month`,`year`), '%m/%d/%Y') from t1;
select * from t2 where f1=STR_TO_DATE('4/1/2010', '%m/%d/%Y');
f1
2010-04-01 00:00:00
t2 should be const
explain select * from t2 where f1=STR_TO_DATE('4/1/2010', '%m/%d/%Y');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 8 const 1 Using index
DROP TABLE t1,t2;
#
# End of 5.5 tests
# End of 5.5 tests
#
#
mysql-test/r/type_newdecimal.result
View file @
3a43a2e2
...
@@ -1908,4 +1908,16 @@ group by PAY.id + 1;
...
@@ -1908,4 +1908,16 @@ group by PAY.id + 1;
mult v_net_with_discount v_total
mult v_net_with_discount v_total
1.0000 27.18 27.180000
1.0000 27.18 27.180000
DROP TABLE currencies, payments, sub_tasks;
DROP TABLE currencies, payments, sub_tasks;
#
# BUG#52171: distinct aggregates on unsigned decimal fields trigger assertions
#
CREATE TABLE t1 (a DECIMAL(4,4) UNSIGNED);
INSERT INTO t1 VALUES (0);
SELECT AVG(DISTINCT a) FROM t1;
AVG(DISTINCT a)
0.00000000
SELECT SUM(DISTINCT a) FROM t1;
SUM(DISTINCT a)
0.0000
DROP TABLE t1;
End of 5.1 tests
End of 5.1 tests
mysql-test/suite/perfschema/include/upgrade_check.inc
View file @
3a43a2e2
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#
#
--
error
1
--
error
1
--
exec
$MYSQL_UPGRADE
--
skip
-
verbose
>
$out_file
2
>
$err_file
--
exec
$MYSQL_UPGRADE
--
skip
-
verbose
--
force
>
$out_file
2
>
$err_file
# Verify that mysql_upgrade complained about the performance_schema
# Verify that mysql_upgrade complained about the performance_schema
--
cat_file
$err_file
--
cat_file
$err_file
...
...
mysql-test/suite/perfschema/r/checksum.result
0 → 100644
View file @
3a43a2e2
checksum table performance_schema.COND_INSTANCES;
checksum table performance_schema.EVENTS_WAITS_CURRENT;
checksum table performance_schema.EVENTS_WAITS_HISTORY;
checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG;
checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
checksum table performance_schema.FILE_INSTANCES;
checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE;
checksum table performance_schema.MUTEX_INSTANCES;
checksum table performance_schema.PERFORMANCE_TIMERS;
checksum table performance_schema.RWLOCK_INSTANCES;
checksum table performance_schema.SETUP_CONSUMERS;
checksum table performance_schema.SETUP_INSTRUMENTS;
checksum table performance_schema.SETUP_TIMERS;
checksum table performance_schema.THREADS;
checksum table performance_schema.COND_INSTANCES extended;
checksum table performance_schema.EVENTS_WAITS_CURRENT extended;
checksum table performance_schema.EVENTS_WAITS_HISTORY extended;
checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG extended;
checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE extended;
checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME extended;
checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME extended;
checksum table performance_schema.FILE_INSTANCES extended;
checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME extended;
checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE extended;
checksum table performance_schema.MUTEX_INSTANCES extended;
checksum table performance_schema.PERFORMANCE_TIMERS extended;
checksum table performance_schema.RWLOCK_INSTANCES extended;
checksum table performance_schema.SETUP_CONSUMERS extended;
checksum table performance_schema.SETUP_INSTRUMENTS extended;
checksum table performance_schema.SETUP_TIMERS extended;
checksum table performance_schema.THREADS extended;
mysql-test/suite/perfschema/r/server_init.result
View file @
3a43a2e2
...
@@ -116,18 +116,10 @@ where name like "wait/synch/mutex/sql/LOCK_rpl_status";
...
@@ -116,18 +116,10 @@ where name like "wait/synch/mutex/sql/LOCK_rpl_status";
count(name)
count(name)
1
1
select count(name) from MUTEX_INSTANCES
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOG_INFO::lock";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex";
where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex";
count(name)
count(name)
1
1
select count(name) from MUTEX_INSTANCES
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state";
count(name)
1
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_event_metadata";
where name like "wait/synch/mutex/sql/LOCK_event_metadata";
count(name)
count(name)
1
1
...
@@ -144,15 +136,15 @@ where name like "wait/synch/mutex/sql/Cversion_lock";
...
@@ -144,15 +136,15 @@ where name like "wait/synch/mutex/sql/Cversion_lock";
count(name)
count(name)
1
1
select count(name) from MUTEX_INSTANCES
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_
xid_cache
";
where name like "wait/synch/mutex/sql/LOCK_
audit_mask
";
count(name)
count(name)
1
1
select count(name) from MUTEX_INSTANCES
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_
plugin
";
where name like "wait/synch/mutex/sql/LOCK_
xid_cache
";
count(name)
count(name)
1
1
select count(name) from MUTEX_INSTANCES
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_
gdl
";
where name like "wait/synch/mutex/sql/LOCK_
plugin
";
count(name)
count(name)
1
1
select count(name) from MUTEX_INSTANCES
select count(name) from MUTEX_INSTANCES
...
@@ -212,10 +204,6 @@ where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
...
@@ -212,10 +204,6 @@ where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
count(name)
count(name)
1
1
select count(name) from COND_INSTANCES
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/Event_scheduler::COND_state";
count(name)
1
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_queue_state";
where name like "wait/synch/cond/sql/COND_queue_state";
count(name)
count(name)
1
1
mysql-test/suite/perfschema/r/start_server_no_cond_class.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_file_class.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 0
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 0
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_file_inst.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 0
performance_schema_max_file_instances 0
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 0
performance_schema_max_mutex_classes 0
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
View file @
3a43a2e2
...
@@ -47,9 +47,9 @@ performance_schema_max_file_instances 10000
...
@@ -47,9 +47,9 @@ performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 0
performance_schema_max_mutex_instances 0
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 0
performance_schema_max_rwlock_classes 0
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 0
performance_schema_max_rwlock_instances 0
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_thread_class.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 0
performance_schema_max_thread_classes 0
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 0
performance_schema_max_thread_instances 0
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_off.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/r/start_server_on.result
View file @
3a43a2e2
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
...
@@ -45,11 +45,11 @@ performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 10000
00
performance_schema_max_mutex_instances 10000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 10000
00
performance_schema_max_rwlock_instances 10000
performance_schema_max_table_handles 1000
00
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
00
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
performance_schema_max_thread_instances 1000
show engine PERFORMANCE_SCHEMA status;
show engine PERFORMANCE_SCHEMA status;
...
...
mysql-test/suite/perfschema/t/checksum.test
0 → 100644
View file @
3a43a2e2
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
# Tests for PERFORMANCE_SCHEMA
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_perfschema
.
inc
#
# The checksum value itself is random (data is volatile),
# just testing that this does not crash
#
--
disable_result_log
checksum
table
performance_schema
.
COND_INSTANCES
;
checksum
table
performance_schema
.
EVENTS_WAITS_CURRENT
;
checksum
table
performance_schema
.
EVENTS_WAITS_HISTORY
;
checksum
table
performance_schema
.
EVENTS_WAITS_HISTORY_LONG
;
checksum
table
performance_schema
.
EVENTS_WAITS_SUMMARY_BY_INSTANCE
;
checksum
table
performance_schema
.
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
;
checksum
table
performance_schema
.
EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
;
checksum
table
performance_schema
.
FILE_INSTANCES
;
checksum
table
performance_schema
.
FILE_SUMMARY_BY_EVENT_NAME
;
checksum
table
performance_schema
.
FILE_SUMMARY_BY_INSTANCE
;
checksum
table
performance_schema
.
MUTEX_INSTANCES
;
checksum
table
performance_schema
.
PERFORMANCE_TIMERS
;
checksum
table
performance_schema
.
RWLOCK_INSTANCES
;
checksum
table
performance_schema
.
SETUP_CONSUMERS
;
checksum
table
performance_schema
.
SETUP_INSTRUMENTS
;
checksum
table
performance_schema
.
SETUP_TIMERS
;
checksum
table
performance_schema
.
THREADS
;
checksum
table
performance_schema
.
COND_INSTANCES
extended
;
checksum
table
performance_schema
.
EVENTS_WAITS_CURRENT
extended
;
checksum
table
performance_schema
.
EVENTS_WAITS_HISTORY
extended
;
checksum
table
performance_schema
.
EVENTS_WAITS_HISTORY_LONG
extended
;
checksum
table
performance_schema
.
EVENTS_WAITS_SUMMARY_BY_INSTANCE
extended
;
checksum
table
performance_schema
.
EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
extended
;
checksum
table
performance_schema
.
EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
extended
;
checksum
table
performance_schema
.
FILE_INSTANCES
extended
;
checksum
table
performance_schema
.
FILE_SUMMARY_BY_EVENT_NAME
extended
;
checksum
table
performance_schema
.
FILE_SUMMARY_BY_INSTANCE
extended
;
checksum
table
performance_schema
.
MUTEX_INSTANCES
extended
;
checksum
table
performance_schema
.
PERFORMANCE_TIMERS
extended
;
checksum
table
performance_schema
.
RWLOCK_INSTANCES
extended
;
checksum
table
performance_schema
.
SETUP_CONSUMERS
extended
;
checksum
table
performance_schema
.
SETUP_INSTRUMENTS
extended
;
checksum
table
performance_schema
.
SETUP_TIMERS
extended
;
checksum
table
performance_schema
.
THREADS
extended
;
--
enable_result_log
mysql-test/suite/perfschema/t/server_init.test
View file @
3a43a2e2
# Copyright (
C) 2009 Sun Microsystems, Inc
# Copyright (
c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
Foundation,
#
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
#
51 Franklin Street, Suite 500, Boston, MA 02110-1335
USA
# Tests for PERFORMANCE_SCHEMA
# Tests for PERFORMANCE_SCHEMA
...
@@ -43,10 +43,6 @@ select count(name) from MUTEX_INSTANCES
...
@@ -43,10 +43,6 @@ select count(name) from MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/mysys/THR_LOCK_myisam"
;
where
name
like
"wait/synch/mutex/mysys/THR_LOCK_myisam"
;
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/mysys/THR_LOCK_myisam_log";
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/mysys/THR_LOCK_heap"
;
where
name
like
"wait/synch/mutex/mysys/THR_LOCK_heap"
;
...
@@ -83,11 +79,6 @@ select count(name) from MUTEX_INSTANCES
...
@@ -83,11 +79,6 @@ select count(name) from MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/LOCK_delayed_insert"
;
where
name
like
"wait/synch/mutex/sql/LOCK_delayed_insert"
;
# Named LOCK_uuid_short in 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/LOCK_uuid_short";
# Named LOCK_uuid_generator in 5.5, LOCK_uuid_short in 6.0
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/LOCK_uuid_generator"
;
where
name
like
"wait/synch/mutex/sql/LOCK_uuid_generator"
;
...
@@ -130,14 +121,16 @@ select count(name) from MUTEX_INSTANCES
...
@@ -130,14 +121,16 @@ select count(name) from MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/LOCK_rpl_status"
;
where
name
like
"wait/synch/mutex/sql/LOCK_rpl_status"
;
select
count
(
name
)
from
MUTEX_INSTANCES
# LOG_INFO object are created on demand, and are not global.
where
name
like
"wait/synch/mutex/sql/LOG_INFO::lock"
;
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/LOG_INFO::lock";
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/Query_cache::structure_guard_mutex"
;
where
name
like
"wait/synch/mutex/sql/Query_cache::structure_guard_mutex"
;
select
count
(
name
)
from
MUTEX_INSTANCES
# The event scheduler may be disabled
where
name
like
"wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state"
;
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state";
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/LOCK_event_metadata"
;
where
name
like
"wait/synch/mutex/sql/LOCK_event_metadata"
;
...
@@ -148,16 +141,11 @@ select count(name) from MUTEX_INSTANCES
...
@@ -148,16 +141,11 @@ select count(name) from MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/LOCK_user_locks"
;
where
name
like
"wait/synch/mutex/sql/LOCK_user_locks"
;
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/LOCK_mdl";
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/Cversion_lock"
;
where
name
like
"wait/synch/mutex/sql/Cversion_lock"
;
# Does not exist in mysql 5.5, 6.0 only
select
count
(
name
)
from
MUTEX_INSTANCES
# select count(name) from MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/LOCK_audit_mask"
;
# where name like "wait/synch/mutex/sql/LOCK_audit_mask";
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/LOCK_xid_cache"
;
where
name
like
"wait/synch/mutex/sql/LOCK_xid_cache"
;
...
@@ -165,28 +153,13 @@ select count(name) from MUTEX_INSTANCES
...
@@ -165,28 +153,13 @@ select count(name) from MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/LOCK_plugin"
;
where
name
like
"wait/synch/mutex/sql/LOCK_plugin"
;
select
count
(
name
)
from
MUTEX_INSTANCES
# Not a global variable, may be destroyed already.
where
name
like
"wait/synch/mutex/sql/LOCK_gdl"
;
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/LOCK_gdl";
select
count
(
name
)
from
MUTEX_INSTANCES
select
count
(
name
)
from
MUTEX_INSTANCES
where
name
like
"wait/synch/mutex/sql/tz_LOCK"
;
where
name
like
"wait/synch/mutex/sql/tz_LOCK"
;
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/slave_start";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML_active";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML_get";
# Verify that these global rwlocks have been properly initilized in sql
# Verify that these global rwlocks have been properly initilized in sql
select
count
(
name
)
from
RWLOCK_INSTANCES
select
count
(
name
)
from
RWLOCK_INSTANCES
...
@@ -230,25 +203,10 @@ select count(name) from COND_INSTANCES
...
@@ -230,25 +203,10 @@ select count(name) from COND_INSTANCES
select
count
(
name
)
from
COND_INSTANCES
select
count
(
name
)
from
COND_INSTANCES
where
name
like
"wait/synch/cond/sql/Query_cache::COND_cache_status_changed"
;
where
name
like
"wait/synch/cond/sql/Query_cache::COND_cache_status_changed"
;
select
count
(
name
)
from
COND_INSTANCES
# The event scheduler may be disabled
where
name
like
"wait/synch/cond/sql/Event_scheduler::COND_state"
;
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/Event_scheduler::COND_state";
select
count
(
name
)
from
COND_INSTANCES
select
count
(
name
)
from
COND_INSTANCES
where
name
like
"wait/synch/cond/sql/COND_queue_state"
;
where
name
like
"wait/synch/cond/sql/COND_queue_state"
;
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/COND_mdl";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/BML_class::COND_BML";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/BML_class::COND_BML_registered";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/BML_class::COND_BML_release";
mysql-test/t/strict.test
View file @
3a43a2e2
...
@@ -192,11 +192,11 @@ INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
...
@@ -192,11 +192,11 @@ INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
# All test cases expected to fail should return
# All test cases expected to fail should return
# SQLSTATE 22007 <invalid date value>
# SQLSTATE 22007 <invalid date value>
--
error
1411
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'31.10.0000 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'31.10.0000 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1411
--
error
1292
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'31.0.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'31.0.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1
292
--
error
1
411
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'0.10.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'0.10.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1292
--
error
1292
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'31.9.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'31.9.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
...
@@ -206,18 +206,18 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
...
@@ -206,18 +206,18 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'29.02.2003 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'29.02.2003 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1411
--
error
1411
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'15.13.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'15.13.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1
292
--
error
1
411
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'00.00.0000'
,
'%d.%m.%Y'
));
INSERT
INTO
t1
(
col1
)
VALUES
(
STR_TO_DATE
(
'00.00.0000'
,
'%d.%m.%Y'
));
## Test INSERT with STR_TO_DATE into DATETIME
## Test INSERT with STR_TO_DATE into DATETIME
# All test cases expected to fail should return
# All test cases expected to fail should return
# SQLSTATE 22007 <invalid datetime value>
# SQLSTATE 22007 <invalid datetime value>
--
error
1411
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'31.10.0000 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'31.10.0000 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1411
--
error
1292
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'31.0.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'31.0.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1
292
--
error
1
411
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'0.10.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'0.10.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1292
--
error
1292
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'31.9.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'31.9.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
...
@@ -227,18 +227,18 @@ INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
...
@@ -227,18 +227,18 @@ INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'29.02.2003 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'29.02.2003 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1411
--
error
1411
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'15.13.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'15.13.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1
292
--
error
1
411
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'00.00.0000'
,
'%d.%m.%Y'
));
INSERT
INTO
t1
(
col2
)
VALUES
(
STR_TO_DATE
(
'00.00.0000'
,
'%d.%m.%Y'
));
## Test INSERT with STR_TO_DATE into TIMESTAMP
## Test INSERT with STR_TO_DATE into TIMESTAMP
# All test cases expected to fail should return
# All test cases expected to fail should return
# SQLSTATE 22007 <invalid datetime value>
# SQLSTATE 22007 <invalid datetime value>
--
error
1
292
--
error
1
411
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'31.10.0000 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'31.10.0000 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1
292
--
error
1
411
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'31.0.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'31.0.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1
292
--
error
1
411
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'0.10.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'0.10.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1292
--
error
1292
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'31.9.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'31.9.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
...
@@ -248,7 +248,7 @@ INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
...
@@ -248,7 +248,7 @@ INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'29.02.2003 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'29.02.2003 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1411
--
error
1411
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'15.13.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'15.13.2004 15.30'
,
'%d.%m.%Y %H.%i'
));
--
error
1
292
--
error
1
411
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'00.00.0000'
,
'%d.%m.%Y'
));
INSERT
INTO
t1
(
col3
)
VALUES
(
STR_TO_DATE
(
'00.00.0000'
,
'%d.%m.%Y'
));
drop
table
t1
;
drop
table
t1
;
...
...
mysql-test/t/type_datetime.test
View file @
3a43a2e2
...
@@ -461,6 +461,29 @@ EXPLAIN EXTENDED SELECT * FROM t1 FORCE INDEX(attime) WHERE AtTime = '2010-02-22
...
@@ -461,6 +461,29 @@ EXPLAIN EXTENDED SELECT * FROM t1 FORCE INDEX(attime) WHERE AtTime = '2010-02-22
DROP
TABLE
t1
;
DROP
TABLE
t1
;
SET
NAMES
latin1
;
SET
NAMES
latin1
;
--
echo
#
--
echo
# Bug#56271: Wrong comparison result with STR_TO_DATE function
--
echo
#
CREATE
TABLE
t1
(
`year`
int
(
4
)
NOT
NULL
,
`month`
int
(
2
)
NOT
NULL
);
INSERT
INTO
t1
VALUES
(
2010
,
3
),(
2010
,
4
),(
2009
,
8
),(
2008
,
9
);
SELECT
*
FROM
t1
WHERE
STR_TO_DATE
(
CONCAT_WS
(
'/01/'
,
`month`
,
`year`
),
'%m/%d/%Y'
)
>=
STR_TO_DATE
(
'1/1/2010'
,
'%m/%d/%Y'
);
create
table
t2
(
f1
datetime
primary
key
);
insert
into
t2
select
STR_TO_DATE
(
CONCAT_WS
(
'/01/'
,
`month`
,
`year`
),
'%m/%d/%Y'
)
from
t1
;
select
*
from
t2
where
f1
=
STR_TO_DATE
(
'4/1/2010'
,
'%m/%d/%Y'
);
--
echo
t2
should
be
const
explain
select
*
from
t2
where
f1
=
STR_TO_DATE
(
'4/1/2010'
,
'%m/%d/%Y'
);
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
#
--
echo
# End of 5.5 tests
--
echo
# End of 5.5 tests
--
echo
#
--
echo
#
mysql-test/t/type_newdecimal.test
View file @
3a43a2e2
...
@@ -1509,5 +1509,14 @@ group by PAY.id + 1;
...
@@ -1509,5 +1509,14 @@ group by PAY.id + 1;
DROP
TABLE
currencies
,
payments
,
sub_tasks
;
DROP
TABLE
currencies
,
payments
,
sub_tasks
;
--
echo
#
--
echo
# BUG#52171: distinct aggregates on unsigned decimal fields trigger assertions
--
echo
#
CREATE
TABLE
t1
(
a
DECIMAL
(
4
,
4
)
UNSIGNED
);
INSERT
INTO
t1
VALUES
(
0
);
SELECT
AVG
(
DISTINCT
a
)
FROM
t1
;
SELECT
SUM
(
DISTINCT
a
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
mysql-test/valgrind.supp
View file @
3a43a2e2
...
@@ -745,3 +745,38 @@
...
@@ -745,3 +745,38 @@
Memcheck:Addr1
Memcheck:Addr1
fun:buf_buddy_relocate
fun:buf_buddy_relocate
}
}
#
# See related Bug#56666
# Race condition between the server main thread and the kill server thread.
#
# Because of this race condition, the call to shutdown_performance_schema()
# was commented in sql/mysqld.cc, causing the reported leaks.
#
{
missing shutdown_performance_schema 1
Memcheck:Leak
fun:malloc
fun:_Z10pfs_mallocmi
}
{
missing shutdown_performance_schema 2
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:_lf_alloc_new
fun:lf_hash_insert
}
{
missing shutdown_performance_schema 3
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:initialize_bucket
fun:lf_hash_search
fun:_Z19find_or_create_fileP10PFS_threadP14PFS_file_classPKcj
}
mysys/my_gethwaddr.c
View file @
3a43a2e2
...
@@ -64,7 +64,7 @@ my_bool my_gethwaddr(uchar *to)
...
@@ -64,7 +64,7 @@ my_bool my_gethwaddr(uchar *to)
if
(
ifm
->
ifm_type
==
RTM_IFINFO
)
if
(
ifm
->
ifm_type
==
RTM_IFINFO
)
{
{
sdl
=
(
struct
sockaddr_dl
*
)(
ifm
+
1
);
sdl
=
(
struct
sockaddr_dl
*
)(
ifm
+
1
);
addr
=
LLADDR
(
sdl
);
addr
=
(
uchar
*
)
LLADDR
(
sdl
);
res
=
memcpy_and_test
(
to
,
addr
,
ETHER_ADDR_LEN
);
res
=
memcpy_and_test
(
to
,
addr
,
ETHER_ADDR_LEN
);
}
}
}
}
...
...
mysys/my_sync.c
View file @
3a43a2e2
...
@@ -100,9 +100,9 @@ static const char cur_dir_name[]= {FN_CURLIB, 0};
...
@@ -100,9 +100,9 @@ static const char cur_dir_name[]= {FN_CURLIB, 0};
RETURN
RETURN
0 if ok, !=0 if error
0 if ok, !=0 if error
*/
*/
#ifdef NEED_EXPLICIT_SYNC_DIR
int
my_sync_dir
(
const
char
*
dir_name
,
myf
my_flags
)
int
my_sync_dir
(
const
char
*
dir_name
,
myf
my_flags
)
{
{
#ifdef NEED_EXPLICIT_SYNC_DIR
File
dir_fd
;
File
dir_fd
;
int
res
=
0
;
int
res
=
0
;
const
char
*
correct_dir_name
;
const
char
*
correct_dir_name
;
...
@@ -124,10 +124,14 @@ int my_sync_dir(const char *dir_name, myf my_flags)
...
@@ -124,10 +124,14 @@ int my_sync_dir(const char *dir_name, myf my_flags)
else
else
res
=
1
;
res
=
1
;
DBUG_RETURN
(
res
);
DBUG_RETURN
(
res
);
#else
}
#else
/* NEED_EXPLICIT_SYNC_DIR */
int
my_sync_dir
(
const
char
*
dir_name
__attribute__
((
unused
)),
myf
my_flags
__attribute__
((
unused
)))
{
return
0
;
return
0
;
#endif
}
}
#endif
/* NEED_EXPLICIT_SYNC_DIR */
/*
/*
...
@@ -141,15 +145,18 @@ int my_sync_dir(const char *dir_name, myf my_flags)
...
@@ -141,15 +145,18 @@ int my_sync_dir(const char *dir_name, myf my_flags)
RETURN
RETURN
0 if ok, !=0 if error
0 if ok, !=0 if error
*/
*/
#ifdef NEED_EXPLICIT_SYNC_DIR
int
my_sync_dir_by_file
(
const
char
*
file_name
,
myf
my_flags
)
int
my_sync_dir_by_file
(
const
char
*
file_name
,
myf
my_flags
)
{
{
#ifdef NEED_EXPLICIT_SYNC_DIR
char
dir_name
[
FN_REFLEN
];
char
dir_name
[
FN_REFLEN
];
size_t
dir_name_length
;
size_t
dir_name_length
;
dirname_part
(
dir_name
,
file_name
,
&
dir_name_length
);
dirname_part
(
dir_name
,
file_name
,
&
dir_name_length
);
return
my_sync_dir
(
dir_name
,
my_flags
);
return
my_sync_dir
(
dir_name
,
my_flags
);
#else
}
#else
/* NEED_EXPLICIT_SYNC_DIR */
int
my_sync_dir_by_file
(
const
char
*
file_name
__attribute__
((
unused
)),
myf
my_flags
__attribute__
((
unused
)))
{
return
0
;
return
0
;
#endif
}
}
#endif
/* NEED_EXPLICIT_SYNC_DIR */
sql/field.cc
View file @
3a43a2e2
...
@@ -9104,7 +9104,7 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
...
@@ -9104,7 +9104,7 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
case
MYSQL_TYPE_NEWDECIMAL
:
case
MYSQL_TYPE_NEWDECIMAL
:
case
MYSQL_TYPE_FLOAT
:
case
MYSQL_TYPE_FLOAT
:
case
MYSQL_TYPE_DOUBLE
:
case
MYSQL_TYPE_DOUBLE
:
pack_flag
=
FIELDFLAG_
DECIMAL
|
FIELDFLAG_
NUMBER
|
pack_flag
=
FIELDFLAG_NUMBER
|
(
decimals_arg
&
FIELDFLAG_MAX_DEC
)
<<
FIELDFLAG_DEC_SHIFT
;
(
decimals_arg
&
FIELDFLAG_MAX_DEC
)
<<
FIELDFLAG_DEC_SHIFT
;
break
;
break
;
...
@@ -9153,12 +9153,13 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
...
@@ -9153,12 +9153,13 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
(
maybe_null
?
FIELDFLAG_MAYBE_NULL
:
0
)
|
(
maybe_null
?
FIELDFLAG_MAYBE_NULL
:
0
)
|
(
is_unsigned
?
0
:
FIELDFLAG_DECIMAL
);
(
is_unsigned
?
0
:
FIELDFLAG_DECIMAL
);
DBUG_PRINT
(
"debug"
,
(
"pack_flag: %s%s%s%s%s, pack_type: %d"
,
DBUG_PRINT
(
"debug"
,
(
"pack_flag: %s%s%s%s%s
%s
, pack_type: %d"
,
FLAGSTR
(
pack_flag
,
FIELDFLAG_BINARY
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_BINARY
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_NUMBER
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_NUMBER
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_INTERVAL
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_INTERVAL
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_GEOM
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_GEOM
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_BLOB
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_BLOB
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_DECIMAL
),
f_packtype
(
pack_flag
)));
f_packtype
(
pack_flag
)));
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
sql/item_timefunc.cc
View file @
3a43a2e2
...
@@ -3368,6 +3368,8 @@ void Item_func_str_to_date::fix_length_and_dec()
...
@@ -3368,6 +3368,8 @@ void Item_func_str_to_date::fix_length_and_dec()
cached_field_type
=
MYSQL_TYPE_DATETIME
;
cached_field_type
=
MYSQL_TYPE_DATETIME
;
max_length
=
MAX_DATETIME_FULL_WIDTH
*
MY_CHARSET_BIN_MB_MAXLEN
;
max_length
=
MAX_DATETIME_FULL_WIDTH
*
MY_CHARSET_BIN_MB_MAXLEN
;
cached_timestamp_type
=
MYSQL_TIMESTAMP_NONE
;
cached_timestamp_type
=
MYSQL_TIMESTAMP_NONE
;
sql_mode
=
(
current_thd
->
variables
.
sql_mode
&
(
MODE_NO_ZERO_IN_DATE
|
MODE_NO_ZERO_DATE
));
if
((
const_item
=
args
[
1
]
->
const_item
()))
if
((
const_item
=
args
[
1
]
->
const_item
()))
{
{
char
format_buff
[
64
];
char
format_buff
[
64
];
...
@@ -3433,6 +3435,14 @@ bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
...
@@ -3433,6 +3435,14 @@ bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
return
0
;
return
0
;
null_date:
null_date:
if
(
fuzzy_date
&
TIME_NO_ZERO_DATE
)
{
char
buff
[
128
];
strmake
(
buff
,
val
->
ptr
(),
min
(
val
->
length
(),
sizeof
(
buff
)
-
1
));
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WRONG_VALUE_FOR_TYPE
,
ER
(
ER_WRONG_VALUE_FOR_TYPE
),
"datetime"
,
buff
,
"str_to_date"
);
}
return
(
null_value
=
1
);
return
(
null_value
=
1
);
}
}
...
@@ -3442,7 +3452,7 @@ String *Item_func_str_to_date::val_str(String *str)
...
@@ -3442,7 +3452,7 @@ String *Item_func_str_to_date::val_str(String *str)
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
MYSQL_TIME
ltime
;
MYSQL_TIME
ltime
;
if
(
Item_func_str_to_date
::
get_date
(
&
ltime
,
TIME_FUZZY_DATE
))
if
(
Item_func_str_to_date
::
get_date
(
&
ltime
,
TIME_FUZZY_DATE
|
sql_mode
))
return
0
;
return
0
;
if
(
!
make_datetime
((
const_item
?
cached_format_type
:
if
(
!
make_datetime
((
const_item
?
cached_format_type
:
...
@@ -3453,6 +3463,29 @@ String *Item_func_str_to_date::val_str(String *str)
...
@@ -3453,6 +3463,29 @@ String *Item_func_str_to_date::val_str(String *str)
}
}
longlong
Item_func_str_to_date
::
val_int
()
{
DBUG_ASSERT
(
fixed
==
1
);
MYSQL_TIME
ltime
;
if
(
Item_func_str_to_date
::
get_date
(
&
ltime
,
TIME_FUZZY_DATE
|
sql_mode
))
return
0
;
if
(
const_item
)
{
switch
(
cached_field_type
)
{
case
MYSQL_TYPE_DATE
:
return
TIME_to_ulonglong_date
(
&
ltime
);
case
MYSQL_TYPE_TIME
:
return
TIME_to_ulonglong_time
(
&
ltime
);
default:
return
TIME_to_ulonglong_datetime
(
&
ltime
);
}
}
return
TIME_to_ulonglong_datetime
(
&
ltime
);
}
bool
Item_func_last_day
::
get_date
(
MYSQL_TIME
*
ltime
,
uint
fuzzy_date
)
bool
Item_func_last_day
::
get_date
(
MYSQL_TIME
*
ltime
,
uint
fuzzy_date
)
{
{
if
(
get_arg0_date
(
ltime
,
fuzzy_date
&
~
TIME_FUZZY_DATE
)
||
if
(
get_arg0_date
(
ltime
,
fuzzy_date
&
~
TIME_FUZZY_DATE
)
||
...
...
sql/item_timefunc.h
View file @
3a43a2e2
...
@@ -1039,6 +1039,7 @@ class Item_func_str_to_date :public Item_str_func
...
@@ -1039,6 +1039,7 @@ class Item_func_str_to_date :public Item_str_func
date_time_format_types
cached_format_type
;
date_time_format_types
cached_format_type
;
timestamp_type
cached_timestamp_type
;
timestamp_type
cached_timestamp_type
;
bool
const_item
;
bool
const_item
;
ulonglong
sql_mode
;
public:
public:
Item_func_str_to_date
(
Item
*
a
,
Item
*
b
)
Item_func_str_to_date
(
Item
*
a
,
Item
*
b
)
:
Item_str_func
(
a
,
b
),
const_item
(
false
)
:
Item_str_func
(
a
,
b
),
const_item
(
false
)
...
@@ -1052,6 +1053,8 @@ class Item_func_str_to_date :public Item_str_func
...
@@ -1052,6 +1053,8 @@ class Item_func_str_to_date :public Item_str_func
{
{
return
tmp_table_field_from_field_type
(
table
,
1
);
return
tmp_table_field_from_field_type
(
table
,
1
);
}
}
longlong
val_int
();
bool
result_as_longlong
()
{
return
TRUE
;
}
};
};
...
...
sql/log.cc
View file @
3a43a2e2
...
@@ -5284,11 +5284,8 @@ int MYSQL_BIN_LOG::wait_for_update_bin_log(THD* thd,
...
@@ -5284,11 +5284,8 @@ int MYSQL_BIN_LOG::wait_for_update_bin_log(THD* thd,
const
struct
timespec
*
timeout
)
const
struct
timespec
*
timeout
)
{
{
int
ret
=
0
;
int
ret
=
0
;
const
char
*
old_msg
=
thd
->
proc_info
;
DBUG_ENTER
(
"wait_for_update_bin_log"
);
DBUG_ENTER
(
"wait_for_update_bin_log"
);
old_msg
=
thd
->
enter_cond
(
&
update_cond
,
&
LOCK_log
,
"Master has sent all binlog to slave; "
"waiting for binlog to be updated"
);
if
(
!
timeout
)
if
(
!
timeout
)
mysql_cond_wait
(
&
update_cond
,
&
LOCK_log
);
mysql_cond_wait
(
&
update_cond
,
&
LOCK_log
);
else
else
...
...
sql/log.h
View file @
3a43a2e2
...
@@ -460,6 +460,7 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
...
@@ -460,6 +460,7 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
inline
char
*
get_log_fname
()
{
return
log_file_name
;
}
inline
char
*
get_log_fname
()
{
return
log_file_name
;
}
inline
char
*
get_name
()
{
return
name
;
}
inline
char
*
get_name
()
{
return
name
;
}
inline
mysql_mutex_t
*
get_log_lock
()
{
return
&
LOCK_log
;
}
inline
mysql_mutex_t
*
get_log_lock
()
{
return
&
LOCK_log
;
}
inline
mysql_cond_t
*
get_log_cond
()
{
return
&
update_cond
;
}
inline
IO_CACHE
*
get_log_file
()
{
return
&
log_file
;
}
inline
IO_CACHE
*
get_log_file
()
{
return
&
log_file
;
}
inline
void
lock_index
()
{
mysql_mutex_lock
(
&
LOCK_index
);}
inline
void
lock_index
()
{
mysql_mutex_lock
(
&
LOCK_index
);}
...
...
sql/mysqld.cc
View file @
3a43a2e2
...
@@ -1395,6 +1395,12 @@ static void mysqld_exit(int exit_code)
...
@@ -1395,6 +1395,12 @@ static void mysqld_exit(int exit_code)
mysql_audit_finalize
();
mysql_audit_finalize
();
clean_up_mutexes
();
clean_up_mutexes
();
clean_up_error_log_mutex
();
clean_up_error_log_mutex
();
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
/*
Bug#56666 needs to be fixed before calling:
shutdown_performance_schema();
*/
#endif
my_end
(
opt_endinfo
?
MY_CHECK_ERROR
|
MY_GIVE_INFO
:
0
);
my_end
(
opt_endinfo
?
MY_CHECK_ERROR
|
MY_GIVE_INFO
:
0
);
exit
(
exit_code
);
/* purecov: inspected */
exit
(
exit_code
);
/* purecov: inspected */
}
}
...
@@ -2733,6 +2739,11 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
...
@@ -2733,6 +2739,11 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
if
(
!
abort_loop
)
if
(
!
abort_loop
)
{
{
abort_loop
=
1
;
// mark abort for threads
abort_loop
=
1
;
// mark abort for threads
#ifdef HAVE_PSI_INTERFACE
/* Delete the instrumentation for the signal thread */
if
(
likely
(
PSI_server
!=
NULL
))
PSI_server
->
delete_current_thread
();
#endif
#ifdef USE_ONE_SIGNAL_HAND
#ifdef USE_ONE_SIGNAL_HAND
pthread_t
tmp
;
pthread_t
tmp
;
if
(
mysql_thread_create
(
0
,
/* Not instrumented */
if
(
mysql_thread_create
(
0
,
/* Not instrumented */
...
@@ -4588,6 +4599,15 @@ int mysqld_main(int argc, char **argv)
...
@@ -4588,6 +4599,15 @@ int mysqld_main(int argc, char **argv)
#endif
#endif
#endif
/* __WIN__ */
#endif
/* __WIN__ */
#ifdef HAVE_PSI_INTERFACE
/*
Disable the main thread instrumentation,
to avoid recording events during the shutdown.
*/
if
(
PSI_server
)
PSI_server
->
delete_current_thread
();
#endif
/* Wait until cleanup is done */
/* Wait until cleanup is done */
mysql_mutex_lock
(
&
LOCK_thread_count
);
mysql_mutex_lock
(
&
LOCK_thread_count
);
while
(
!
ready_to_exit
)
while
(
!
ready_to_exit
)
...
@@ -4605,18 +4625,6 @@ int mysqld_main(int argc, char **argv)
...
@@ -4605,18 +4625,6 @@ int mysqld_main(int argc, char **argv)
}
}
#endif
#endif
clean_up
(
1
);
clean_up
(
1
);
#ifdef HAVE_PSI_INTERFACE
/*
Disable the instrumentation, to avoid recording events
during the shutdown.
*/
if
(
PSI_server
)
{
PSI_server
->
delete_current_thread
();
PSI_server
=
NULL
;
}
shutdown_performance_schema
();
#endif
mysqld_exit
(
0
);
mysqld_exit
(
0
);
}
}
...
...
sql/set_var.h
View file @
3a43a2e2
...
@@ -91,6 +91,9 @@ class sys_var
...
@@ -91,6 +91,9 @@ class sys_var
longlong
def_val
,
PolyLock
*
lock
,
enum
binlog_status_enum
binlog_status_arg
,
longlong
def_val
,
PolyLock
*
lock
,
enum
binlog_status_enum
binlog_status_arg
,
on_check_function
on_check_func
,
on_update_function
on_update_func
,
on_check_function
on_check_func
,
on_update_function
on_update_func
,
uint
deprecated_version
,
const
char
*
substitute
,
int
parse_flag
);
uint
deprecated_version
,
const
char
*
substitute
,
int
parse_flag
);
virtual
~
sys_var
()
{}
/**
/**
All the cleanup procedures should be performed here
All the cleanup procedures should be performed here
*/
*/
...
...
sql/sql_plugin.cc
View file @
3a43a2e2
...
@@ -519,7 +519,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
...
@@ -519,7 +519,7 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
/* no op */
;
/* no op */
;
cur
=
(
struct
st_mysql_plugin
*
)
cur
=
(
struct
st_mysql_plugin
*
)
my_malloc
(
i
*
sizeof
(
struct
st_mysql_plugin
),
MYF
(
MY_ZEROFILL
|
MY_WME
));
my_malloc
((
i
+
1
)
*
sizeof
(
struct
st_mysql_plugin
),
MYF
(
MY_ZEROFILL
|
MY_WME
));
if
(
!
cur
)
if
(
!
cur
)
{
{
free_plugin_mem
(
&
plugin_dl
);
free_plugin_mem
(
&
plugin_dl
);
...
...
sql/sql_repl.cc
View file @
3a43a2e2
...
@@ -448,6 +448,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
...
@@ -448,6 +448,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
const
char
*
errmsg
=
"Unknown error"
;
const
char
*
errmsg
=
"Unknown error"
;
NET
*
net
=
&
thd
->
net
;
NET
*
net
=
&
thd
->
net
;
mysql_mutex_t
*
log_lock
;
mysql_mutex_t
*
log_lock
;
mysql_cond_t
*
log_cond
;
bool
binlog_can_be_corrupted
=
FALSE
;
bool
binlog_can_be_corrupted
=
FALSE
;
#ifndef DBUG_OFF
#ifndef DBUG_OFF
int
left_events
=
max_binlog_dump_events
;
int
left_events
=
max_binlog_dump_events
;
...
@@ -591,7 +593,8 @@ impossible position";
...
@@ -591,7 +593,8 @@ impossible position";
mysql_bin_log, and it's already inited, and it will be destroyed
mysql_bin_log, and it's already inited, and it will be destroyed
only at shutdown).
only at shutdown).
*/
*/
log_lock
=
mysql_bin_log
.
get_log_lock
();
log_lock
=
mysql_bin_log
.
get_log_lock
();
log_cond
=
mysql_bin_log
.
get_log_cond
();
if
(
pos
>
BIN_LOG_HEADER_SIZE
)
if
(
pos
>
BIN_LOG_HEADER_SIZE
)
{
{
/* reset transmit packet for the event read from binary log
/* reset transmit packet for the event read from binary log
...
@@ -826,6 +829,7 @@ impossible position";
...
@@ -826,6 +829,7 @@ impossible position";
#ifndef DBUG_OFF
#ifndef DBUG_OFF
ulong
hb_info_counter
=
0
;
ulong
hb_info_counter
=
0
;
#endif
#endif
const
char
*
old_msg
=
thd
->
proc_info
;
signal_cnt
=
mysql_bin_log
.
signal_cnt
;
signal_cnt
=
mysql_bin_log
.
signal_cnt
;
do
do
{
{
...
@@ -834,6 +838,9 @@ impossible position";
...
@@ -834,6 +838,9 @@ impossible position";
DBUG_ASSERT
(
heartbeat_ts
&&
heartbeat_period
!=
0
);
DBUG_ASSERT
(
heartbeat_ts
&&
heartbeat_period
!=
0
);
set_timespec_nsec
(
*
heartbeat_ts
,
heartbeat_period
);
set_timespec_nsec
(
*
heartbeat_ts
,
heartbeat_period
);
}
}
thd
->
enter_cond
(
log_cond
,
log_lock
,
"Master has sent all binlog to slave; "
"waiting for binlog to be updated"
);
ret
=
mysql_bin_log
.
wait_for_update_bin_log
(
thd
,
heartbeat_ts
);
ret
=
mysql_bin_log
.
wait_for_update_bin_log
(
thd
,
heartbeat_ts
);
DBUG_ASSERT
(
ret
==
0
||
(
heartbeat_period
!=
0
&&
coord
!=
NULL
));
DBUG_ASSERT
(
ret
==
0
||
(
heartbeat_period
!=
0
&&
coord
!=
NULL
));
if
(
ret
==
ETIMEDOUT
||
ret
==
ETIME
)
if
(
ret
==
ETIMEDOUT
||
ret
==
ETIME
)
...
@@ -849,12 +856,15 @@ impossible position";
...
@@ -849,12 +856,15 @@ impossible position";
#endif
#endif
/* reset transmit packet for the heartbeat event */
/* reset transmit packet for the heartbeat event */
if
(
reset_transmit_packet
(
thd
,
flags
,
&
ev_offset
,
&
errmsg
))
if
(
reset_transmit_packet
(
thd
,
flags
,
&
ev_offset
,
&
errmsg
))
{
thd
->
exit_cond
(
old_msg
);
goto
err
;
goto
err
;
}
if
(
send_heartbeat_event
(
net
,
packet
,
coord
))
if
(
send_heartbeat_event
(
net
,
packet
,
coord
))
{
{
errmsg
=
"Failed on my_net_write()"
;
errmsg
=
"Failed on my_net_write()"
;
my_errno
=
ER_UNKNOWN_ERROR
;
my_errno
=
ER_UNKNOWN_ERROR
;
mysql_mutex_unlock
(
log_lock
);
thd
->
exit_cond
(
old_msg
);
goto
err
;
goto
err
;
}
}
}
}
...
@@ -863,7 +873,7 @@ impossible position";
...
@@ -863,7 +873,7 @@ impossible position";
DBUG_PRINT
(
"wait"
,(
"binary log received update or a broadcast signal caught"
));
DBUG_PRINT
(
"wait"
,(
"binary log received update or a broadcast signal caught"
));
}
}
}
while
(
signal_cnt
==
mysql_bin_log
.
signal_cnt
&&
!
thd
->
killed
);
}
while
(
signal_cnt
==
mysql_bin_log
.
signal_cnt
&&
!
thd
->
killed
);
mysql_mutex_unlock
(
log_lock
);
thd
->
exit_cond
(
old_msg
);
}
}
break
;
break
;
...
...
storage/perfschema/ha_perfschema.cc
View file @
3a43a2e2
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "my_global.h"
#include "my_global.h"
#include "my_pthread.h"
#include "my_pthread.h"
#include "my_atomic.h"
#include "sql_plugin.h"
#include "sql_plugin.h"
#include "mysql/plugin.h"
#include "mysql/plugin.h"
#include "ha_perfschema.h"
#include "ha_perfschema.h"
...
@@ -28,6 +29,17 @@
...
@@ -28,6 +29,17 @@
#include "pfs_instr_class.h"
#include "pfs_instr_class.h"
#include "pfs_instr.h"
#include "pfs_instr.h"
#ifdef MY_ATOMIC_MODE_DUMMY
/*
The performance schema can can not function with MY_ATOMIC_MODE_DUMMY,
a fully functional implementation of MY_ATOMIC should be used instead.
If the build fails with this error message:
- either use a different ./configure --with-atomic-ops option
- or do not build with the performance schema.
*/
#error "The performance schema needs a functional MY_ATOMIC implementation."
#endif
handlerton
*
pfs_hton
=
NULL
;
handlerton
*
pfs_hton
=
NULL
;
static
handler
*
pfs_create_handler
(
handlerton
*
hton
,
static
handler
*
pfs_create_handler
(
handlerton
*
hton
,
...
...
storage/perfschema/pfs_engine_table.cc
View file @
3a43a2e2
...
@@ -223,6 +223,8 @@ int PFS_engine_table::read_row(TABLE *table,
...
@@ -223,6 +223,8 @@ int PFS_engine_table::read_row(TABLE *table,
Field
**
fields
)
Field
**
fields
)
{
{
my_bitmap_map
*
org_bitmap
;
my_bitmap_map
*
org_bitmap
;
Field
*
f
;
Field
**
fields_reset
;
/*
/*
Make sure the table structure is as expected before mapping
Make sure the table structure is as expected before mapping
...
@@ -240,6 +242,16 @@ int PFS_engine_table::read_row(TABLE *table,
...
@@ -240,6 +242,16 @@ int PFS_engine_table::read_row(TABLE *table,
/* We internally write to Fields to support the read interface */
/* We internally write to Fields to support the read interface */
org_bitmap
=
dbug_tmp_use_all_columns
(
table
,
table
->
write_set
);
org_bitmap
=
dbug_tmp_use_all_columns
(
table
,
table
->
write_set
);
/*
Some callers of the storage engine interface do not honor the
f->is_null() flag, and will attempt to read the data itself.
A known offender is mysql_checksum_table().
For robustness, reset every field.
*/
for
(
fields_reset
=
fields
;
(
f
=
*
fields_reset
)
;
fields_reset
++
)
f
->
reset
();
int
result
=
read_row_values
(
table
,
buf
,
fields
,
read_all
);
int
result
=
read_row_values
(
table
,
buf
,
fields
,
read_all
);
dbug_tmp_restore_column_map
(
table
->
write_set
,
org_bitmap
);
dbug_tmp_restore_column_map
(
table
->
write_set
,
org_bitmap
);
...
...
storage/perfschema/table_events_waits.cc
View file @
3a43a2e2
...
@@ -187,7 +187,7 @@ void table_events_waits_common::clear_object_columns()
...
@@ -187,7 +187,7 @@ void table_events_waits_common::clear_object_columns()
*/
*/
void
table_events_waits_common
::
make_row
(
bool
thread_own_wait
,
void
table_events_waits_common
::
make_row
(
bool
thread_own_wait
,
PFS_thread
*
pfs_thread
,
PFS_thread
*
pfs_thread
,
PFS_events_waits
*
wait
)
volatile
PFS_events_waits
*
wait
)
{
{
pfs_lock
lock
;
pfs_lock
lock
;
PFS_thread
*
safe_thread
;
PFS_thread
*
safe_thread
;
...
@@ -251,21 +251,27 @@ void table_events_waits_common::make_row(bool thread_own_wait,
...
@@ -251,21 +251,27 @@ void table_events_waits_common::make_row(bool thread_own_wait,
case
WAIT_CLASS_TABLE
:
case
WAIT_CLASS_TABLE
:
m_row
.
m_object_type
=
"TABLE"
;
m_row
.
m_object_type
=
"TABLE"
;
m_row
.
m_object_type_length
=
5
;
m_row
.
m_object_type_length
=
5
;
memcpy
(
m_row
.
m_object_schema
,
wait
->
m_schema_name
,
wait
->
m_schema_name_length
);
m_row
.
m_object_schema_length
=
wait
->
m_schema_name_length
;
m_row
.
m_object_schema_length
=
wait
->
m_schema_name_length
;
memcpy
(
m_row
.
m_object_name
,
wait
->
m_object_name
,
if
(
unlikely
((
m_row
.
m_object_schema_length
==
0
)
||
wait
->
m_object_name_length
);
(
m_row
.
m_object_schema_length
>
sizeof
(
m_row
.
m_object_schema
))))
return
;
memcpy
(
m_row
.
m_object_schema
,
wait
->
m_schema_name
,
m_row
.
m_object_schema_length
);
m_row
.
m_object_name_length
=
wait
->
m_object_name_length
;
m_row
.
m_object_name_length
=
wait
->
m_object_name_length
;
if
(
unlikely
((
m_row
.
m_object_name_length
==
0
)
||
(
m_row
.
m_object_name_length
>
sizeof
(
m_row
.
m_object_name
))))
return
;
memcpy
(
m_row
.
m_object_name
,
wait
->
m_object_name
,
m_row
.
m_object_name_length
);
safe_class
=
&
global_table_class
;
safe_class
=
&
global_table_class
;
break
;
break
;
case
WAIT_CLASS_FILE
:
case
WAIT_CLASS_FILE
:
m_row
.
m_object_type
=
"FILE"
;
m_row
.
m_object_type
=
"FILE"
;
m_row
.
m_object_type_length
=
4
;
m_row
.
m_object_type_length
=
4
;
m_row
.
m_object_schema_length
=
0
;
m_row
.
m_object_schema_length
=
0
;
memcpy
(
m_row
.
m_object_name
,
wait
->
m_object_name
,
wait
->
m_object_name_length
);
m_row
.
m_object_name_length
=
wait
->
m_object_name_length
;
m_row
.
m_object_name_length
=
wait
->
m_object_name_length
;
if
(
unlikely
((
m_row
.
m_object_name_length
==
0
)
||
(
m_row
.
m_object_name_length
>
sizeof
(
m_row
.
m_object_name
))))
return
;
memcpy
(
m_row
.
m_object_name
,
wait
->
m_object_name
,
m_row
.
m_object_name_length
);
safe_class
=
sanitize_file_class
((
PFS_file_class
*
)
wait
->
m_class
);
safe_class
=
sanitize_file_class
((
PFS_file_class
*
)
wait
->
m_class
);
break
;
break
;
case
NO_WAIT_CLASS
:
case
NO_WAIT_CLASS
:
...
...
storage/perfschema/table_events_waits.h
View file @
3a43a2e2
...
@@ -137,7 +137,7 @@ class table_events_waits_common : public PFS_engine_table
...
@@ -137,7 +137,7 @@ class table_events_waits_common : public PFS_engine_table
void
clear_object_columns
();
void
clear_object_columns
();
void
make_row
(
bool
thread_own_wait
,
PFS_thread
*
pfs_thread
,
void
make_row
(
bool
thread_own_wait
,
PFS_thread
*
pfs_thread
,
PFS_events_waits
*
wait
);
volatile
PFS_events_waits
*
wait
);
/** Current row. */
/** Current row. */
row_events_waits
m_row
;
row_events_waits
m_row
;
...
...
strings/my_vsnprintf.c
View file @
3a43a2e2
...
@@ -255,7 +255,7 @@ static char *process_int_arg(char *to, char *end, size_t length,
...
@@ -255,7 +255,7 @@ static char *process_int_arg(char *to, char *end, size_t length,
if
((
to_length
=
(
size_t
)
(
end
-
to
))
<
16
||
length
)
if
((
to_length
=
(
size_t
)
(
end
-
to
))
<
16
||
length
)
store_start
=
buff
;
store_start
=
buff
;
if
(
arg_type
==
'd'
)
if
(
arg_type
==
'd'
||
arg_type
==
'i'
)
store_end
=
longlong10_to_str
(
par
,
store_start
,
-
10
);
store_end
=
longlong10_to_str
(
par
,
store_start
,
-
10
);
else
if
(
arg_type
==
'u'
)
else
if
(
arg_type
==
'u'
)
store_end
=
longlong10_to_str
(
par
,
store_start
,
10
);
store_end
=
longlong10_to_str
(
par
,
store_start
,
10
);
...
@@ -399,6 +399,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end,
...
@@ -399,6 +399,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end,
args_arr
[
i
].
double_arg
=
va_arg
(
ap
,
double
);
args_arr
[
i
].
double_arg
=
va_arg
(
ap
,
double
);
break
;
break
;
case
'd'
:
case
'd'
:
case
'i'
:
case
'u'
:
case
'u'
:
case
'x'
:
case
'x'
:
case
'X'
:
case
'X'
:
...
@@ -406,7 +407,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end,
...
@@ -406,7 +407,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end,
case
'p'
:
case
'p'
:
if
(
args_arr
[
i
].
have_longlong
)
if
(
args_arr
[
i
].
have_longlong
)
args_arr
[
i
].
longlong_arg
=
va_arg
(
ap
,
longlong
);
args_arr
[
i
].
longlong_arg
=
va_arg
(
ap
,
longlong
);
else
if
(
args_arr
[
i
].
arg_type
==
'd'
)
else
if
(
args_arr
[
i
].
arg_type
==
'd'
||
args_arr
[
i
].
arg_type
==
'i'
)
args_arr
[
i
].
longlong_arg
=
va_arg
(
ap
,
int
);
args_arr
[
i
].
longlong_arg
=
va_arg
(
ap
,
int
);
else
else
args_arr
[
i
].
longlong_arg
=
va_arg
(
ap
,
uint
);
args_arr
[
i
].
longlong_arg
=
va_arg
(
ap
,
uint
);
...
@@ -458,6 +459,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end,
...
@@ -458,6 +459,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end,
break
;
break
;
}
}
case
'd'
:
case
'd'
:
case
'i'
:
case
'u'
:
case
'u'
:
case
'x'
:
case
'x'
:
case
'X'
:
case
'X'
:
...
@@ -472,7 +474,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end,
...
@@ -472,7 +474,7 @@ static char *process_args(CHARSET_INFO *cs, char *to, char *end,
if
(
args_arr
[
print_arr
[
i
].
arg_idx
].
have_longlong
)
if
(
args_arr
[
print_arr
[
i
].
arg_idx
].
have_longlong
)
larg
=
args_arr
[
print_arr
[
i
].
arg_idx
].
longlong_arg
;
larg
=
args_arr
[
print_arr
[
i
].
arg_idx
].
longlong_arg
;
else
if
(
print_arr
[
i
].
arg_type
==
'd'
)
else
if
(
print_arr
[
i
].
arg_type
==
'd'
||
print_arr
[
i
].
arg_type
==
'i'
)
larg
=
(
int
)
args_arr
[
print_arr
[
i
].
arg_idx
].
longlong_arg
;
larg
=
(
int
)
args_arr
[
print_arr
[
i
].
arg_idx
].
longlong_arg
;
else
else
larg
=
(
uint
)
args_arr
[
print_arr
[
i
].
arg_idx
].
longlong_arg
;
larg
=
(
uint
)
args_arr
[
print_arr
[
i
].
arg_idx
].
longlong_arg
;
...
@@ -615,8 +617,8 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
...
@@ -615,8 +617,8 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
to
=
process_dbl_arg
(
to
,
end
,
width
,
d
,
*
fmt
);
to
=
process_dbl_arg
(
to
,
end
,
width
,
d
,
*
fmt
);
continue
;
continue
;
}
}
else
if
(
*
fmt
==
'd'
||
*
fmt
==
'
u'
||
*
fmt
==
'x'
||
*
fmt
==
'X'
||
else
if
(
*
fmt
==
'd'
||
*
fmt
==
'
i'
||
*
fmt
==
'u'
||
*
fmt
==
'x'
||
*
fmt
==
'p'
||
*
fmt
==
'o'
)
*
fmt
==
'
X'
||
*
fmt
==
'
p'
||
*
fmt
==
'o'
)
{
{
/* Integer parameter */
/* Integer parameter */
longlong
larg
;
longlong
larg
;
...
@@ -625,7 +627,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
...
@@ -625,7 +627,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
if
(
have_longlong
)
if
(
have_longlong
)
larg
=
va_arg
(
ap
,
longlong
);
larg
=
va_arg
(
ap
,
longlong
);
else
if
(
*
fmt
==
'd'
)
else
if
(
*
fmt
==
'd'
||
*
fmt
==
'i'
)
larg
=
va_arg
(
ap
,
int
);
larg
=
va_arg
(
ap
,
int
);
else
else
larg
=
va_arg
(
ap
,
uint
);
larg
=
va_arg
(
ap
,
uint
);
...
...
unittest/mysys/my_vsnprintf-t.c
View file @
3a43a2e2
...
@@ -31,7 +31,7 @@ void test1(const char *res, const char *fmt, ...)
...
@@ -31,7 +31,7 @@ void test1(const char *res, const char *fmt, ...)
int
main
(
void
)
int
main
(
void
)
{
{
plan
(
5
4
);
plan
(
5
8
);
test1
(
"Constant string"
,
test1
(
"Constant string"
,
"Constant string"
);
"Constant string"
);
...
@@ -44,6 +44,8 @@ int main(void)
...
@@ -44,6 +44,8 @@ int main(void)
"Format specifier c %c"
,
'!'
);
"Format specifier c %c"
,
'!'
);
test1
(
"Format specifier d 1"
,
test1
(
"Format specifier d 1"
,
"Format specifier d %d"
,
1
);
"Format specifier d %d"
,
1
);
test1
(
"Format specifier i 1"
,
"Format specifier i %i"
,
1
);
test1
(
"Format specifier u 2"
,
test1
(
"Format specifier u 2"
,
"Format specifier u %u"
,
2
);
"Format specifier u %u"
,
2
);
test1
(
"Format specifier o 375"
,
test1
(
"Format specifier o 375"
,
...
@@ -77,6 +79,9 @@ int main(void)
...
@@ -77,6 +79,9 @@ int main(void)
test1
(
"Length modifiers work: 1 * -1 * 2 * 3"
,
test1
(
"Length modifiers work: 1 * -1 * 2 * 3"
,
"Length modifiers work: %d * %ld * %lld * %zd"
,
1
,
-
1L
,
2LL
,
(
size_t
)
3
);
"Length modifiers work: %d * %ld * %lld * %zd"
,
1
,
-
1L
,
2LL
,
(
size_t
)
3
);
test1
(
"Length modifiers work: 1 * -1 * 2 * 3"
,
"Length modifiers work: %i * %li * %lli * %zd"
,
1
,
-
1L
,
2LL
,
(
size_t
)
3
);
test1
(
"long long X: 123456789abcdef0"
,
test1
(
"long long X: 123456789abcdef0"
,
"long long X: %llx"
,
0x123456789abcdef0LL
);
"long long X: %llx"
,
0x123456789abcdef0LL
);
...
@@ -121,6 +126,10 @@ int main(void)
...
@@ -121,6 +126,10 @@ int main(void)
"Hello int, %d"
,
1
);
"Hello int, %d"
,
1
);
test1
(
"Hello int, -1"
,
test1
(
"Hello int, -1"
,
"Hello int, %d"
,
-
1
);
"Hello int, %d"
,
-
1
);
test1
(
"Hello int, 1"
,
"Hello int, %i"
,
1
);
test1
(
"Hello int, -1"
,
"Hello int, %i"
,
-
1
);
test1
(
"Hello string 'I am a string'"
,
test1
(
"Hello string 'I am a string'"
,
"Hello string '%s'"
,
"I am a string"
);
"Hello string '%s'"
,
"I am a string"
);
test1
(
"Hello hack hack hack hack hack hack hack 1"
,
test1
(
"Hello hack hack hack hack hack hack hack 1"
,
...
...
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