mysql-5.5.38 merge
This commit is contained in:
commit
5d16592d44
@ -1,7 +1,7 @@
|
|||||||
#ifndef ERRMSG_INCLUDED
|
#ifndef ERRMSG_INCLUDED
|
||||||
#define ERRMSG_INCLUDED
|
#define ERRMSG_INCLUDED
|
||||||
|
|
||||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2000, 2014, 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
|
||||||
@ -32,7 +32,9 @@ extern const char *client_errors[]; /* Error messages */
|
|||||||
#define CR_MIN_ERROR 2000 /* For easier client code */
|
#define CR_MIN_ERROR 2000 /* For easier client code */
|
||||||
#define CR_MAX_ERROR 2999
|
#define CR_MAX_ERROR 2999
|
||||||
#if !defined(ER)
|
#if !defined(ER)
|
||||||
#define ER(X) client_errors[(X)-CR_MIN_ERROR]
|
#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \
|
||||||
|
client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR])
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
|
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2000, 2014, 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
|
||||||
@ -105,6 +105,8 @@ const char** get_client_errmsgs()
|
|||||||
|
|
||||||
void init_client_errs(void)
|
void init_client_errs(void)
|
||||||
{
|
{
|
||||||
|
compile_time_assert(array_elements(client_errors) ==
|
||||||
|
(CR_ERROR_LAST - CR_ERROR_FIRST + 2));
|
||||||
(void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST);
|
(void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates
|
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates
|
||||||
Copyright (c) 2009, 2013, Monty Program Ab
|
Copyright (c) 2009, 2014, Monty Program Ab
|
||||||
|
|
||||||
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
|
||||||
@ -1339,6 +1339,10 @@ static my_bool my_realloc_str(NET *net, ulong length)
|
|||||||
res= net_realloc(net, buf_length + length);
|
res= net_realloc(net, buf_length + length);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
|
if (net->last_errno == ER_OUT_OF_RESOURCES)
|
||||||
|
net->last_errno= CR_OUT_OF_MEMORY;
|
||||||
|
else if (net->last_errno == ER_NET_PACKET_TOO_LARGE)
|
||||||
|
net->last_errno= CR_NET_PACKET_TOO_LARGE;
|
||||||
strmov(net->sqlstate, unknown_sqlstate);
|
strmov(net->sqlstate, unknown_sqlstate);
|
||||||
strmov(net->last_error, ER(net->last_errno));
|
strmov(net->last_error, ER(net->last_errno));
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ main.signal_demo3 @solaris # Bug#11753919 2010-01-20 alik Several
|
|||||||
main.sp @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
main.sp @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||||
main.wait_timeout @solaris # Bug#11758972 2010-04-26 alik wait_timeout fails on OpenSolaris
|
main.wait_timeout @solaris # Bug#11758972 2010-04-26 alik wait_timeout fails on OpenSolaris
|
||||||
|
|
||||||
rpl.rpl_innodb_bug28430 # Bug#11754425
|
|
||||||
rpl.rpl_row_sp011 @solaris # Bug#11753919 2011-07-25 sven Several test cases fail on Solaris with error Thread stack overrun
|
rpl.rpl_row_sp011 @solaris # Bug#11753919 2011-07-25 sven Several test cases fail on Solaris with error Thread stack overrun
|
||||||
rpl.rpl_spec_variables @solaris # Bug #17337114 2013-08-20 Luis Soares failing on pb2 with timeout for 'CHECK WARNINGS'
|
rpl.rpl_spec_variables @solaris # Bug #17337114 2013-08-20 Luis Soares failing on pb2 with timeout for 'CHECK WARNINGS'
|
||||||
|
|
||||||
|
@ -520,3 +520,15 @@ LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug11735141.txt' INTO TABLE t1;
|
|||||||
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
|
||||||
drop table t1;
|
drop table t1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
#
|
||||||
|
# Bug#11759519 INFINITE HANG WITH 100% CPU USAGE WITH LOAD DATA LOCAL AND IMPORT ERRORS
|
||||||
|
#
|
||||||
|
SET @old_mode= @@sql_mode;
|
||||||
|
CREATE TABLE t1 (fld1 INT);
|
||||||
|
SET sql_mode='strict_all_tables';
|
||||||
|
# Without fix, load data hangs forever.
|
||||||
|
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/mysql' REPLACE INTO TABLE t1
|
||||||
|
FIELDS TERMINATED BY 't' LINES TERMINATED BY '';
|
||||||
|
Got one of the listed errors
|
||||||
|
SET @@sql_mode= @old_mode;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -147,6 +147,14 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
|||||||
a b c
|
a b c
|
||||||
1 ABC-АБВ DEF-ÂÃÄ
|
1 ABC-АБВ DEF-ÂÃÄ
|
||||||
2 NULL NULL
|
2 NULL NULL
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a b c
|
||||||
|
1 ABC-АБВ DEF-ÂÃÄ
|
||||||
|
2 NULL NULL
|
||||||
|
SELECT * FROM t2;
|
||||||
|
a b c
|
||||||
|
1 ABC-АБВ DEF-ÂÃÄ
|
||||||
|
2 NULL NULL
|
||||||
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES STARTING BY 'ъ';
|
SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES STARTING BY 'ъ';
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1638 Non-ASCII separator arguments are not fully supported
|
Warning 1638 Non-ASCII separator arguments are not fully supported
|
||||||
@ -175,6 +183,14 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
|||||||
a b c
|
a b c
|
||||||
1 ABC-АБВ DEF-ÂÃÄ
|
1 ABC-АБВ DEF-ÂÃÄ
|
||||||
2 NULL NULL
|
2 NULL NULL
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a b c
|
||||||
|
1 ABC-АБВ DEF-ÂÃÄ
|
||||||
|
2 NULL NULL
|
||||||
|
SELECT * FROM t2;
|
||||||
|
a b c
|
||||||
|
1 ABC-АБВ DEF-ÂÃÄ
|
||||||
|
2 NULL NULL
|
||||||
# Default (binary) charset:
|
# Default (binary) charset:
|
||||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FROM t1;
|
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FROM t1;
|
||||||
##################################################
|
##################################################
|
||||||
|
33
mysql-test/suite/binlog/r/binlog_truncate_kill.result
Normal file
33
mysql-test/suite/binlog/r/binlog_truncate_kill.result
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
RESET MASTER;
|
||||||
|
connection default;
|
||||||
|
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB;
|
||||||
|
INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10);
|
||||||
|
SET DEBUG_SYNC = "open_and_process_table signal truncate_before_lock wait_for forever";
|
||||||
|
TRUNCATE t1;
|
||||||
|
connect con1,localhost,root,,;
|
||||||
|
SET DEBUG_SYNC = "now wait_for truncate_before_lock";
|
||||||
|
SELECT ((@id := id) - id) FROM information_schema.processlist WHERE processlist.info LIKE '%TRUNCATE t1%' AND state LIKE '%open_and_process_table%';
|
||||||
|
((@id := id) - id)
|
||||||
|
0
|
||||||
|
KILL QUERY @id;
|
||||||
|
connection default;
|
||||||
|
ERROR 70100: Query execution was interrupted
|
||||||
|
connection con1;
|
||||||
|
show binlog events from <binlog_start>;
|
||||||
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
|
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB
|
||||||
|
master-bin.000001 # Query # # BEGIN
|
||||||
|
master-bin.000001 # Intvar # # INSERT_ID=1
|
||||||
|
master-bin.000001 # Query # # use `test`; INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10)
|
||||||
|
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||||
|
disconnect con1;
|
||||||
|
connection default;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id a b
|
||||||
|
1 1 2
|
||||||
|
2 2 4
|
||||||
|
3 3 6
|
||||||
|
4 4 8
|
||||||
|
5 5 10
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET DEBUG_SYNC= 'RESET';
|
57
mysql-test/suite/binlog/t/binlog_truncate_kill.test
Normal file
57
mysql-test/suite/binlog/t/binlog_truncate_kill.test
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
###############################################################################
|
||||||
|
# Bug#17942050:KILL OF TRUNCATE TABLE WILL LEAD TO BINARY LOG WRITTEN WHILE
|
||||||
|
# ROWS REMAINS
|
||||||
|
#
|
||||||
|
# Problem:
|
||||||
|
# ========
|
||||||
|
# When truncate table fails while using transactional based engines even
|
||||||
|
# though the operation errors out we still continue and log it to binlog.
|
||||||
|
# Because of this master has data but the truncate will be written to binary
|
||||||
|
# log which will cause inconsistency.
|
||||||
|
#
|
||||||
|
# Test:
|
||||||
|
# =====
|
||||||
|
# Make master to wait in "open_table" call during the execution of truncate
|
||||||
|
# table command and kill the truncate table from other connection. This causes
|
||||||
|
# open table to return an error saying truncate failed during open table. This
|
||||||
|
# statement should not be binlogged.
|
||||||
|
###############################################################################
|
||||||
|
--source include/have_innodb.inc
|
||||||
|
--source include/have_debug_sync.inc
|
||||||
|
--source include/have_binlog_format_statement.inc
|
||||||
|
RESET MASTER;
|
||||||
|
--enable_connect_log
|
||||||
|
--connection default
|
||||||
|
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB;
|
||||||
|
INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10);
|
||||||
|
SET DEBUG_SYNC = "open_and_process_table signal truncate_before_lock wait_for forever";
|
||||||
|
--send TRUNCATE t1
|
||||||
|
|
||||||
|
connect(con1,localhost,root,,);
|
||||||
|
SET DEBUG_SYNC = "now wait_for truncate_before_lock";
|
||||||
|
# Wait for one connection to reach open_and_process_table.
|
||||||
|
--let $show_statement= SHOW PROCESSLIST
|
||||||
|
--let $field= State
|
||||||
|
--let $condition= 'debug sync point: open_and_process_table';
|
||||||
|
--source include/wait_show_condition.inc
|
||||||
|
|
||||||
|
SELECT ((@id := id) - id) FROM information_schema.processlist WHERE processlist.info LIKE '%TRUNCATE t1%' AND state LIKE '%open_and_process_table%';
|
||||||
|
# Test killing from mysql server
|
||||||
|
KILL QUERY @id;
|
||||||
|
|
||||||
|
connection default;
|
||||||
|
--ERROR ER_QUERY_INTERRUPTED
|
||||||
|
--reap
|
||||||
|
|
||||||
|
connection con1;
|
||||||
|
--source include/show_binlog_events.inc
|
||||||
|
|
||||||
|
disconnect con1;
|
||||||
|
--source include/wait_until_disconnected.inc
|
||||||
|
connection default;
|
||||||
|
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET DEBUG_SYNC= 'RESET';
|
||||||
|
--disable_connect_log
|
28
mysql-test/suite/rpl/r/rpl_row_create_select.result
Normal file
28
mysql-test/suite/rpl/r/rpl_row_create_select.result
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
include/master-slave.inc
|
||||||
|
[connection master]
|
||||||
|
#
|
||||||
|
# BUG#17994219: CREATE TABLE .. SELECT PRODUCES INVALID STRUCTURE,
|
||||||
|
# BREAKS RBR
|
||||||
|
#
|
||||||
|
#After the patch, the display width is set to a default
|
||||||
|
#value of 21.
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('A', 1000) DIV 1 AS a;
|
||||||
|
Warnings:
|
||||||
|
Warning 1918 Encountered illegal value '' when converting to DECIMAL
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` bigint(21) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
CREATE TABLE t2 AS SELECT CONVERT(REPEAT('A', 255) USING UCS2) DIV 1 AS a;
|
||||||
|
Warnings:
|
||||||
|
Warning 1918 Encountered illegal value '' when converting to DECIMAL
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`a` bigint(21) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
#After the patch, no error is reported.
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
include/rpl_end.inc
|
@ -363,13 +363,11 @@ let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_b
|
|||||||
--connection master
|
--connection master
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
DROP EVENT e1;
|
DROP EVENT e1;
|
||||||
|
--sync_slave_with_master
|
||||||
--echo
|
--echo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check received heartbeat events while logs flushed on slave
|
# Check received heartbeat events while logs flushed on slave
|
||||||
--sync_slave_with_master
|
|
||||||
--echo *** Flush logs on slave ***
|
--echo *** Flush logs on slave ***
|
||||||
STOP SLAVE;
|
STOP SLAVE;
|
||||||
RESET SLAVE;
|
RESET SLAVE;
|
||||||
|
28
mysql-test/suite/rpl/t/rpl_row_create_select.test
Normal file
28
mysql-test/suite/rpl/t/rpl_row_create_select.test
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Testing table creations for row-based replication.
|
||||||
|
|
||||||
|
--source include/have_binlog_format_row.inc
|
||||||
|
--source include/master-slave.inc
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # BUG#17994219: CREATE TABLE .. SELECT PRODUCES INVALID STRUCTURE,
|
||||||
|
--echo # BREAKS RBR
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
--echo #After the patch, the display width is set to a default
|
||||||
|
--echo #value of 21.
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('A', 1000) DIV 1 AS a;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t2 AS SELECT CONVERT(REPEAT('A', 255) USING UCS2) DIV 1 AS a;
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
|
||||||
|
--echo #After the patch, no error is reported.
|
||||||
|
sync_slave_with_master;
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
|
||||||
|
--source include/rpl_end.inc
|
||||||
|
|
@ -637,3 +637,24 @@ create table t1(a point);
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
--echo End of 5.1 tests
|
--echo End of 5.1 tests
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Bug#11759519 INFINITE HANG WITH 100% CPU USAGE WITH LOAD DATA LOCAL AND IMPORT ERRORS
|
||||||
|
--echo #
|
||||||
|
SET @old_mode= @@sql_mode;
|
||||||
|
CREATE TABLE t1 (fld1 INT);
|
||||||
|
--copy_file $EXE_MYSQL $MYSQLTEST_VARDIR/mysql
|
||||||
|
|
||||||
|
SET sql_mode='strict_all_tables';
|
||||||
|
|
||||||
|
--echo # Without fix, load data hangs forever.
|
||||||
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||||
|
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,1000
|
||||||
|
eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/mysql' REPLACE INTO TABLE t1
|
||||||
|
FIELDS TERMINATED BY 't' LINES TERMINATED BY '';
|
||||||
|
|
||||||
|
SET @@sql_mode= @old_mode;
|
||||||
|
|
||||||
|
--remove_file $MYSQLTEST_VARDIR/mysql
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
@ -169,6 +169,8 @@ TRUNCATE t2;
|
|||||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'ъ'
|
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'ъ'
|
||||||
--remove_file $file
|
--remove_file $file
|
||||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
|
||||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||||
--eval SELECT * FROM t1 INTO OUTFILE '$file' LINES STARTING BY 'ъ'
|
--eval SELECT * FROM t1 INTO OUTFILE '$file' LINES STARTING BY 'ъ'
|
||||||
@ -191,6 +193,8 @@ TRUNCATE t2;
|
|||||||
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary LINES TERMINATED BY 'ъ'
|
--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary LINES TERMINATED BY 'ъ'
|
||||||
--remove_file $file
|
--remove_file $file
|
||||||
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
|
||||||
--echo # Default (binary) charset:
|
--echo # Default (binary) charset:
|
||||||
|
|
||||||
|
@ -306,6 +306,9 @@ my_bool my_thread_init(void)
|
|||||||
struct st_my_thread_var *tmp;
|
struct st_my_thread_var *tmp;
|
||||||
my_bool error=0;
|
my_bool error=0;
|
||||||
|
|
||||||
|
if (!my_thread_global_init_done)
|
||||||
|
return 1; /* cannot proceed with unintialized library */
|
||||||
|
|
||||||
#ifdef EXTRA_DEBUG_THREADS
|
#ifdef EXTRA_DEBUG_THREADS
|
||||||
fprintf(stderr,"my_thread_init(): pthread_self: %p\n", pthread_self());
|
fprintf(stderr,"my_thread_init(): pthread_self: %p\n", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
0
packaging/rpm-oel/filter-provides.sh
Normal file → Executable file
0
packaging/rpm-oel/filter-provides.sh
Normal file → Executable file
0
packaging/rpm-oel/filter-requires.sh
Normal file → Executable file
0
packaging/rpm-oel/filter-requires.sh
Normal file → Executable file
@ -85,7 +85,7 @@ Name: mysql-%{product_suffix}
|
|||||||
Summary: A very fast and reliable SQL database server
|
Summary: A very fast and reliable SQL database server
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
Version: @VERSION@
|
Version: @VERSION@
|
||||||
Release: 4%{?dist}
|
Release: 2%{?commercial:.1}%{?dist}
|
||||||
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
|
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field.
|
||||||
Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
|
Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
|
||||||
URL: http://www.mysql.com/
|
URL: http://www.mysql.com/
|
||||||
@ -153,13 +153,17 @@ Requires: procps
|
|||||||
Requires: shadow-utils
|
Requires: shadow-utils
|
||||||
Requires: net-tools
|
Requires: net-tools
|
||||||
%if 0%{?commercial}
|
%if 0%{?commercial}
|
||||||
|
Provides: MySQL-server-advanced%{?_isa} = %{version}-%{release}
|
||||||
|
Obsoletes: MySQL-server-advanced < %{version}-%{release}
|
||||||
Obsoletes: mysql-community-server < %{version}-%{release}
|
Obsoletes: mysql-community-server < %{version}-%{release}
|
||||||
Requires: mysql-enterprise-client%{?_isa} = %{version}-%{release}
|
Requires: mysql-enterprise-client%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release}
|
Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release}
|
||||||
%else
|
%else
|
||||||
|
Provides: MySQL-server%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-community-client%{?_isa} = %{version}-%{release}
|
Requires: mysql-community-client%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
|
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
|
Obsoletes: MySQL-server < %{version}-%{release}
|
||||||
Obsoletes: mysql-server < %{version}-%{release}
|
Obsoletes: mysql-server < %{version}-%{release}
|
||||||
Obsoletes: mariadb-server
|
Obsoletes: mariadb-server
|
||||||
Provides: mysql-server = %{version}-%{release}
|
Provides: mysql-server = %{version}-%{release}
|
||||||
@ -199,11 +203,15 @@ to run and administer a MySQL server.
|
|||||||
Summary: MySQL database client applications and tools
|
Summary: MySQL database client applications and tools
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
%if 0%{?commercial}
|
%if 0%{?commercial}
|
||||||
|
Provides: MySQL-client-advanced%{?_isa} = %{version}-%{release}
|
||||||
|
Obsoletes: MySQL-client-advanced < %{version}-%{release}
|
||||||
Obsoletes: mysql-community-client < %{version}-%{release}
|
Obsoletes: mysql-community-client < %{version}-%{release}
|
||||||
Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
|
Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
|
||||||
%else
|
%else
|
||||||
|
Provides: MySQL-client%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
|
Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
|
Obsoletes: MySQL-client < %{version}-%{release}
|
||||||
Obsoletes: mariadb
|
Obsoletes: mariadb
|
||||||
%if 0%{?rhel} > 5
|
%if 0%{?rhel} > 5
|
||||||
Obsoletes: mysql < %{version}-%{release}
|
Obsoletes: mysql < %{version}-%{release}
|
||||||
@ -234,11 +242,15 @@ MySQL database server, and MySQL embedded server.
|
|||||||
Summary: Test suite for the MySQL database server
|
Summary: Test suite for the MySQL database server
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
%if 0%{?commercial}
|
%if 0%{?commercial}
|
||||||
|
Provides: MySQL-test-advanced%{?_isa} = %{version}-%{release}
|
||||||
|
Obsoletes: MySQL-test-advanced < %{version}-%{release}
|
||||||
Obsoletes: mysql-community-test < %{version}-%{release}
|
Obsoletes: mysql-community-test < %{version}-%{release}
|
||||||
Requires: mysql-enterprise-server%{?_isa} = %{version}-%{release}
|
Requires: mysql-enterprise-server%{?_isa} = %{version}-%{release}
|
||||||
%else
|
%else
|
||||||
|
Provides: MySQL-test%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-community-server%{?_isa} = %{version}-%{release}
|
Requires: mysql-community-server%{?_isa} = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
|
Obsoletes: MySQL-test < %{version}-%{release}
|
||||||
Obsoletes: mysql-test < %{version}-%{release}
|
Obsoletes: mysql-test < %{version}-%{release}
|
||||||
Obsoletes: mariadb-test
|
Obsoletes: mariadb-test
|
||||||
Provides: mysql-test = %{version}-%{release}
|
Provides: mysql-test = %{version}-%{release}
|
||||||
@ -254,11 +266,15 @@ database server.
|
|||||||
Summary: Development header files and libraries for MySQL database client applications
|
Summary: Development header files and libraries for MySQL database client applications
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
%if 0%{?commercial}
|
%if 0%{?commercial}
|
||||||
|
Provides: MySQL-devel-advanced%{?_isa} = %{version}-%{release}
|
||||||
|
Obsoletes: MySQL-devel-advanced < %{version}-%{release}
|
||||||
Obsoletes: mysql-community-devel < %{version}-%{release}
|
Obsoletes: mysql-community-devel < %{version}-%{release}
|
||||||
Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
|
Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
|
||||||
%else
|
%else
|
||||||
|
Provides: MySQL-devel%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
|
Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
|
Obsoletes: MySQL-devel < %{version}-%{release}
|
||||||
Obsoletes: mysql-devel < %{version}-%{release}
|
Obsoletes: mysql-devel < %{version}-%{release}
|
||||||
Obsoletes: mariadb-devel
|
Obsoletes: mariadb-devel
|
||||||
Provides: mysql-devel = %{version}-%{release}
|
Provides: mysql-devel = %{version}-%{release}
|
||||||
@ -272,11 +288,15 @@ to develop MySQL client applications.
|
|||||||
Summary: Shared libraries for MySQL database client applications
|
Summary: Shared libraries for MySQL database client applications
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
%if 0%{?commercial}
|
%if 0%{?commercial}
|
||||||
|
Provides: MySQL-shared-advanced%{?_isa} = %{version}-%{release}
|
||||||
|
Obsoletes: MySQL-shared-advanced < %{version}-%{release}
|
||||||
Obsoletes: mysql-community-libs < %{version}-%{release}
|
Obsoletes: mysql-community-libs < %{version}-%{release}
|
||||||
Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release}
|
Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release}
|
||||||
%else
|
%else
|
||||||
|
Provides: MySQL-shared%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
|
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
|
Obsoletes: MySQL-shared < %{version}-%{release}
|
||||||
Obsoletes: mysql-libs < %{version}-%{release}
|
Obsoletes: mysql-libs < %{version}-%{release}
|
||||||
Obsoletes: mariadb-libs
|
Obsoletes: mariadb-libs
|
||||||
Provides: mysql-libs = %{version}-%{release}
|
Provides: mysql-libs = %{version}-%{release}
|
||||||
@ -294,11 +314,15 @@ Obsoletes: mysql-libs-compat < %{version}-%{release}
|
|||||||
Provides: mysql-libs-compat = %{version}-%{release}
|
Provides: mysql-libs-compat = %{version}-%{release}
|
||||||
Provides: mysql-libs-compat%{?_isa} = %{version}-%{release}
|
Provides: mysql-libs-compat%{?_isa} = %{version}-%{release}
|
||||||
%if 0%{?commercial}
|
%if 0%{?commercial}
|
||||||
|
Provides: MySQL-shared-compat-advanced%{?_isa} = %{version}-%{release}
|
||||||
|
Obsoletes: MySQL-shared-compat-advanced < %{version}-%{release}
|
||||||
Obsoletes: mysql-community-libs-compat < %{version}-%{release}
|
Obsoletes: mysql-community-libs-compat < %{version}-%{release}
|
||||||
Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
|
Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
|
||||||
%else
|
%else
|
||||||
|
Provides: MySQL-shared-compat%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
|
Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
|
Obsoletes: MySQL-shared-compat < %{version}-%{release}
|
||||||
%if 0%{?rhel} > 5
|
%if 0%{?rhel} > 5
|
||||||
Obsoletes: mysql-libs < %{version}-%{release}
|
Obsoletes: mysql-libs < %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
@ -312,11 +336,15 @@ applications.
|
|||||||
Summary: MySQL embedded library
|
Summary: MySQL embedded library
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
%if 0%{?commercial}
|
%if 0%{?commercial}
|
||||||
|
Provides: MySQL-embedded-advanced%{?_isa} = %{version}-%{release}
|
||||||
|
Obsoletes: MySQL-embedded-advanced < %{version}-%{release}
|
||||||
Obsoletes: mysql-community-embedded < %{version}-%{release}
|
Obsoletes: mysql-community-embedded < %{version}-%{release}
|
||||||
Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release}
|
Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release}
|
||||||
%else
|
%else
|
||||||
|
Provides: MySQL-embedded%{?_isa} = %{version}-%{release}
|
||||||
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
|
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
|
||||||
%endif
|
%endif
|
||||||
|
Obsoletes: MySQL-embedded < %{version}-%{release}
|
||||||
Obsoletes: mysql-embedded < %{version}-%{release}
|
Obsoletes: mysql-embedded < %{version}-%{release}
|
||||||
Provides: mysql-embedded = %{version}-%{release}
|
Provides: mysql-embedded = %{version}-%{release}
|
||||||
Provides: mysql-emdedded%{?_isa} = %{version}-%{release}
|
Provides: mysql-emdedded%{?_isa} = %{version}-%{release}
|
||||||
@ -435,20 +463,18 @@ popd
|
|||||||
)
|
)
|
||||||
%endif # 0%{?compatlib}
|
%endif # 0%{?compatlib}
|
||||||
|
|
||||||
export CFLAGS="%{optflags} %{?el7:-DTAOCRYPT_DISABLE_X86ASM}"
|
|
||||||
export CXXFLAGS="%{optflags} %{?el7:-DTAOCRYPT_DISABLE_X86ASM}"
|
|
||||||
|
|
||||||
# Build debug versions of mysqld and libmysqld.a
|
# Build debug versions of mysqld and libmysqld.a
|
||||||
mkdir debug
|
mkdir debug
|
||||||
(
|
(
|
||||||
cd debug
|
cd debug
|
||||||
# Attempt to remove any optimisation flags from the debug build
|
# Attempt to remove any optimisation flags from the debug build
|
||||||
CFLAGS=$(echo "${CFLAGS}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /')
|
optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /')
|
||||||
CXXFLAGS=$(echo "${CFLAGS}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /')
|
|
||||||
cmake ../%{src_dir} \
|
cmake ../%{src_dir} \
|
||||||
-DBUILD_CONFIG=mysql_release \
|
-DBUILD_CONFIG=mysql_release \
|
||||||
-DINSTALL_LAYOUT=RPM \
|
-DINSTALL_LAYOUT=RPM \
|
||||||
-DCMAKE_BUILD_TYPE=Debug %{?el7:-DENABLE_DTRACE=OFF} \
|
-DCMAKE_BUILD_TYPE=Debug %{?el7:-DENABLE_DTRACE=OFF} \
|
||||||
|
-DCMAKE_C_FLAGS="$optflags" \
|
||||||
|
-DCMAKE_CXX_FLAGS="$optflags" \
|
||||||
-DINSTALL_LIBDIR="%{_lib}/mysql" \
|
-DINSTALL_LIBDIR="%{_lib}/mysql" \
|
||||||
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
|
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
|
||||||
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
|
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
|
||||||
@ -470,6 +496,8 @@ mkdir release
|
|||||||
-DBUILD_CONFIG=mysql_release \
|
-DBUILD_CONFIG=mysql_release \
|
||||||
-DINSTALL_LAYOUT=RPM \
|
-DINSTALL_LAYOUT=RPM \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo %{?el7:-DENABLE_DTRACE=OFF} \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo %{?el7:-DENABLE_DTRACE=OFF} \
|
||||||
|
-DCMAKE_C_FLAGS="%{optflags}" \
|
||||||
|
-DCMAKE_CXX_FLAGS="%{optflags}" \
|
||||||
-DINSTALL_LIBDIR="%{_lib}/mysql" \
|
-DINSTALL_LIBDIR="%{_lib}/mysql" \
|
||||||
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
|
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
|
||||||
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
|
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
|
||||||
@ -676,7 +704,41 @@ fi
|
|||||||
%attr(755, root, root) %{_sbindir}/mysqld
|
%attr(755, root, root) %{_sbindir}/mysqld
|
||||||
%attr(755, root, root) %{_sbindir}/mysqld-debug
|
%attr(755, root, root) %{_sbindir}/mysqld-debug
|
||||||
|
|
||||||
%{_libdir}/mysql/plugin
|
%dir %{_libdir}/mysql/plugin
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
|
||||||
|
%dir %{_libdir}/mysql/plugin/debug
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so
|
||||||
|
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
|
||||||
|
%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
|
||||||
|
|
||||||
|
%if 0%{?commercial}
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/audit_log.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/authentication_pam.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/thread_pool.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/audit_log.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/authentication_pam.so
|
||||||
|
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/thread_pool.so
|
||||||
|
%endif
|
||||||
|
|
||||||
%attr(644, root, root) %{_datadir}/mysql/fill_help_tables.sql
|
%attr(644, root, root) %{_datadir}/mysql/fill_help_tables.sql
|
||||||
%attr(644, root, root) %{_datadir}/mysql/mysql_system_tables.sql
|
%attr(644, root, root) %{_datadir}/mysql/mysql_system_tables.sql
|
||||||
@ -819,6 +881,19 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun May 11 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.5.38-2
|
||||||
|
- Increment release version to resolve upgrade conflict issue
|
||||||
|
|
||||||
|
* Thu Apr 24 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.5.38-1
|
||||||
|
- Updated for 5.5.38
|
||||||
|
|
||||||
|
* Mon Apr 07 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.5.37-6
|
||||||
|
- Fix Cflags for el7
|
||||||
|
|
||||||
|
* Mon Mar 31 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.5.37-5
|
||||||
|
- Support for enterprise packages
|
||||||
|
- Upgrade from MySQL-* packages
|
||||||
|
|
||||||
* Fri Mar 14 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.5.37-4
|
* Fri Mar 14 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.5.37-4
|
||||||
- Resolve mysql conflict with mysql-community-client
|
- Resolve mysql conflict with mysql-community-client
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2012, 2014, 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
|
||||||
@ -17,6 +17,10 @@
|
|||||||
# Any files in this directory are auxiliary files for Solaris "pkg" packages.
|
# Any files in this directory are auxiliary files for Solaris "pkg" packages.
|
||||||
# They will be configured during "pkg" creation, not during (binary) build.
|
# They will be configured during "pkg" creation, not during (binary) build.
|
||||||
|
|
||||||
|
IF(NOT CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||||
|
RETURN()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# Currently, this expands to "support-files/" in most layouts,
|
# Currently, this expands to "support-files/" in most layouts,
|
||||||
# but to "/usr/share/mysql/" in a RPM.
|
# but to "/usr/share/mysql/" in a RPM.
|
||||||
# It is important not to pollute "/usr/bin".
|
# It is important not to pollute "/usr/bin".
|
||||||
|
@ -4319,21 +4319,31 @@ const char * STDCALL mysql_error(MYSQL *mysql)
|
|||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
Signed number > 323000
|
Signed number > 323000
|
||||||
|
Zero if there is no connection
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ulong STDCALL
|
ulong STDCALL
|
||||||
mysql_get_server_version(MYSQL *mysql)
|
mysql_get_server_version(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
uint major, minor, version;
|
ulong major= 0, minor= 0, version= 0;
|
||||||
const char *pos= mysql->server_version;
|
|
||||||
char *end_pos;
|
if (mysql->server_version)
|
||||||
/* Skip possible prefix */
|
{
|
||||||
while (*pos && !my_isdigit(&my_charset_latin1, *pos))
|
const char *pos= mysql->server_version;
|
||||||
pos++;
|
char *end_pos;
|
||||||
major= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1;
|
/* Skip possible prefix */
|
||||||
minor= (uint) strtoul(pos, &end_pos, 10); pos=end_pos+1;
|
while (*pos && !my_isdigit(&my_charset_latin1, *pos))
|
||||||
version= (uint) strtoul(pos, &end_pos, 10);
|
pos++;
|
||||||
return (ulong) major*10000L+(ulong) (minor*100+version);
|
major= strtoul(pos, &end_pos, 10); pos=end_pos+1;
|
||||||
|
minor= strtoul(pos, &end_pos, 10); pos=end_pos+1;
|
||||||
|
version= strtoul(pos, &end_pos, 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
|
||||||
|
}
|
||||||
|
|
||||||
|
return major*10000 + minor*100 + version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7081,8 +7081,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
If content of the 'from'-address is cached in the 'value'-object
|
If content of the 'from'-address is cached in the 'value'-object
|
||||||
it is possible that the content needs a character conversion.
|
it is possible that the content needs a character conversion.
|
||||||
*/
|
*/
|
||||||
uint32 dummy_offset;
|
if (!String::needs_conversion_on_storage(length, cs, field_charset))
|
||||||
if (!String::needs_conversion(length, cs, field_charset, &dummy_offset))
|
|
||||||
{
|
{
|
||||||
Field_blob::store_length(length);
|
Field_blob::store_length(length);
|
||||||
bmove(ptr + packlength, &from, sizeof(char*));
|
bmove(ptr + packlength, &from, sizeof(char*));
|
||||||
@ -7650,12 +7649,11 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
{
|
{
|
||||||
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
|
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
|
||||||
int err= 0;
|
int err= 0;
|
||||||
uint32 not_used;
|
|
||||||
char buff[STRING_BUFFER_USUAL_SIZE];
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
||||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||||
|
|
||||||
/* Convert character set if necessary */
|
/* Convert character set if necessary */
|
||||||
if (String::needs_conversion(length, cs, field_charset, ¬_used))
|
if (String::needs_conversion_on_storage(length, cs, field_charset))
|
||||||
{
|
{
|
||||||
uint dummy_errors;
|
uint dummy_errors;
|
||||||
tmpstr.copy(from, length, cs, field_charset, &dummy_errors);
|
tmpstr.copy(from, length, cs, field_charset, &dummy_errors);
|
||||||
@ -7832,12 +7830,11 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
|
|||||||
int err= 0;
|
int err= 0;
|
||||||
char *not_used;
|
char *not_used;
|
||||||
uint not_used2;
|
uint not_used2;
|
||||||
uint32 not_used_offset;
|
|
||||||
char buff[STRING_BUFFER_USUAL_SIZE];
|
char buff[STRING_BUFFER_USUAL_SIZE];
|
||||||
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
String tmpstr(buff,sizeof(buff), &my_charset_bin);
|
||||||
|
|
||||||
/* Convert character set if necessary */
|
/* Convert character set if necessary */
|
||||||
if (String::needs_conversion(length, cs, field_charset, ¬_used_offset))
|
if (String::needs_conversion_on_storage(length, cs, field_charset))
|
||||||
{
|
{
|
||||||
uint dummy_errors;
|
uint dummy_errors;
|
||||||
tmpstr.copy(from, length, cs, field_charset, &dummy_errors);
|
tmpstr.copy(from, length, cs, field_charset, &dummy_errors);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2009, 2013, Monty Program Ab.
|
Copyright (c) 2009, 2014, Monty Program Ab.
|
||||||
|
|
||||||
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
|
||||||
@ -1965,9 +1965,11 @@ void Item_func_int_div::fix_length_and_dec()
|
|||||||
{
|
{
|
||||||
Item_result argtype= args[0]->result_type();
|
Item_result argtype= args[0]->result_type();
|
||||||
/* use precision ony for the data type it is applicable for and valid */
|
/* use precision ony for the data type it is applicable for and valid */
|
||||||
max_length=args[0]->max_length -
|
uint32 char_length= args[0]->max_char_length() -
|
||||||
(argtype == DECIMAL_RESULT || argtype == INT_RESULT ?
|
(argtype == DECIMAL_RESULT || argtype == INT_RESULT ?
|
||||||
args[0]->decimals : 0);
|
args[0]->decimals : 0);
|
||||||
|
fix_char_length(char_length > MY_INT64_NUM_DECIMAL_DIGITS ?
|
||||||
|
MY_INT64_NUM_DECIMAL_DIGITS : char_length);
|
||||||
maybe_null=1;
|
maybe_null=1;
|
||||||
unsigned_flag=args[0]->unsigned_flag | args[1]->unsigned_flag;
|
unsigned_flag=args[0]->unsigned_flag | args[1]->unsigned_flag;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2010, 2013, Monty Progrm Ab
|
Copyright (c) 2010, 2014, Monty Progrm Ab
|
||||||
|
|
||||||
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
|
||||||
@ -59,13 +59,17 @@ XML_TAG::XML_TAG(int l, String f, String v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define GET (stack_pos != stack ? *--stack_pos : my_b_get(&cache))
|
||||||
|
#define PUSH(A) *(stack_pos++)=(A)
|
||||||
|
|
||||||
class READ_INFO {
|
class READ_INFO {
|
||||||
File file;
|
File file;
|
||||||
uchar *buffer, /* Buffer for read text */
|
uchar *buffer, /* Buffer for read text */
|
||||||
*end_of_buff; /* Data in bufferts ends here */
|
*end_of_buff; /* Data in bufferts ends here */
|
||||||
uint buff_length, /* Length of buffert */
|
uint buff_length, /* Length of buffert */
|
||||||
max_length; /* Max length of row */
|
max_length; /* Max length of row */
|
||||||
char *field_term_ptr,*line_term_ptr,*line_start_ptr,*line_start_end;
|
const uchar *field_term_ptr,*line_term_ptr;
|
||||||
|
const char *line_start_ptr,*line_start_end;
|
||||||
uint field_term_length,line_term_length,enclosed_length;
|
uint field_term_length,line_term_length,enclosed_length;
|
||||||
int field_term_char,line_term_char,enclosed_char,escape_char;
|
int field_term_char,line_term_char,enclosed_char,escape_char;
|
||||||
int *stack,*stack_pos;
|
int *stack,*stack_pos;
|
||||||
@ -89,7 +93,7 @@ public:
|
|||||||
int read_fixed_length(void);
|
int read_fixed_length(void);
|
||||||
int next_line(void);
|
int next_line(void);
|
||||||
char unescape(char chr);
|
char unescape(char chr);
|
||||||
int terminator(char *ptr,uint length);
|
int terminator(const uchar *ptr, uint length);
|
||||||
bool find_start_of_fields();
|
bool find_start_of_fields();
|
||||||
/* load xml */
|
/* load xml */
|
||||||
List<XML_TAG> taglist;
|
List<XML_TAG> taglist;
|
||||||
@ -115,6 +119,15 @@ public:
|
|||||||
either the table or THD value
|
either the table or THD value
|
||||||
*/
|
*/
|
||||||
void set_io_cache_arg(void* arg) { cache.arg = arg; }
|
void set_io_cache_arg(void* arg) { cache.arg = arg; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
skip all data till the eof.
|
||||||
|
*/
|
||||||
|
void skip_data_till_eof()
|
||||||
|
{
|
||||||
|
while (GET != my_b_EOF)
|
||||||
|
;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static int read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
static int read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
||||||
@ -546,8 +559,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
|||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
if (read_file_from_client)
|
if (read_file_from_client)
|
||||||
while (!read_info.next_line())
|
read_info.skip_data_till_eof();
|
||||||
;
|
|
||||||
|
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
if (mysql_bin_log.is_open())
|
if (mysql_bin_log.is_open())
|
||||||
@ -1335,10 +1347,18 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
|
|||||||
found_end_of_line(false), eof(false), need_end_io_cache(false),
|
found_end_of_line(false), eof(false), need_end_io_cache(false),
|
||||||
error(false), line_cuted(false), found_null(false), read_charset(cs)
|
error(false), line_cuted(false), found_null(false), read_charset(cs)
|
||||||
{
|
{
|
||||||
field_term_ptr=(char*) field_term.ptr();
|
/*
|
||||||
|
Field and line terminators must be interpreted as sequence of unsigned char.
|
||||||
|
Otherwise, non-ascii terminators will be negative on some platforms,
|
||||||
|
and positive on others (depending on the implementation of char).
|
||||||
|
*/
|
||||||
|
field_term_ptr=
|
||||||
|
static_cast<const uchar*>(static_cast<const void*>(field_term.ptr()));
|
||||||
field_term_length= field_term.length();
|
field_term_length= field_term.length();
|
||||||
line_term_ptr=(char*) line_term.ptr();
|
line_term_ptr=
|
||||||
|
static_cast<const uchar*>(static_cast<const void*>(line_term.ptr()));
|
||||||
line_term_length= line_term.length();
|
line_term_length= line_term.length();
|
||||||
|
|
||||||
level= 0; /* for load xml */
|
level= 0; /* for load xml */
|
||||||
if (line_start.length() == 0)
|
if (line_start.length() == 0)
|
||||||
{
|
{
|
||||||
@ -1347,7 +1367,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
line_start_ptr=(char*) line_start.ptr();
|
line_start_ptr= line_start.ptr();
|
||||||
line_start_end=line_start_ptr+line_start.length();
|
line_start_end=line_start_ptr+line_start.length();
|
||||||
start_of_line= 1;
|
start_of_line= 1;
|
||||||
}
|
}
|
||||||
@ -1356,12 +1376,12 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
|
|||||||
!memcmp(field_term_ptr,line_term_ptr,field_term_length))
|
!memcmp(field_term_ptr,line_term_ptr,field_term_length))
|
||||||
{
|
{
|
||||||
line_term_length=0;
|
line_term_length=0;
|
||||||
line_term_ptr=(char*) "";
|
line_term_ptr= NULL;
|
||||||
}
|
}
|
||||||
enclosed_char= (enclosed_length=enclosed_par.length()) ?
|
enclosed_char= (enclosed_length=enclosed_par.length()) ?
|
||||||
(uchar) enclosed_par[0] : INT_MAX;
|
(uchar) enclosed_par[0] : INT_MAX;
|
||||||
field_term_char= field_term_length ? (uchar) field_term_ptr[0] : INT_MAX;
|
field_term_char= field_term_length ? field_term_ptr[0] : INT_MAX;
|
||||||
line_term_char= line_term_length ? (uchar) line_term_ptr[0] : INT_MAX;
|
line_term_char= line_term_length ? line_term_ptr[0] : INT_MAX;
|
||||||
|
|
||||||
/* Set of a stack for unget if long terminators */
|
/* Set of a stack for unget if long terminators */
|
||||||
uint length= max(cs->mbmaxlen, max(field_term_length, line_term_length)) + 1;
|
uint length= max(cs->mbmaxlen, max(field_term_length, line_term_length)) + 1;
|
||||||
@ -1416,11 +1436,7 @@ READ_INFO::~READ_INFO()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define GET (stack_pos != stack ? *--stack_pos : my_b_get(&cache))
|
inline int READ_INFO::terminator(const uchar *ptr,uint length)
|
||||||
#define PUSH(A) *(stack_pos++)=(A)
|
|
||||||
|
|
||||||
|
|
||||||
inline int READ_INFO::terminator(char *ptr,uint length)
|
|
||||||
{
|
{
|
||||||
int chr=0; // Keep gcc happy
|
int chr=0; // Keep gcc happy
|
||||||
uint i;
|
uint i;
|
||||||
@ -1435,7 +1451,7 @@ inline int READ_INFO::terminator(char *ptr,uint length)
|
|||||||
return 1;
|
return 1;
|
||||||
PUSH(chr);
|
PUSH(chr);
|
||||||
while (i-- > 1)
|
while (i-- > 1)
|
||||||
PUSH((uchar) *--ptr);
|
PUSH(*--ptr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1567,7 +1583,7 @@ int READ_INFO::read_field()
|
|||||||
if (my_mbcharlen(read_charset, chr) > 1 &&
|
if (my_mbcharlen(read_charset, chr) > 1 &&
|
||||||
to + my_mbcharlen(read_charset, chr) <= end_of_buff)
|
to + my_mbcharlen(read_charset, chr) <= end_of_buff)
|
||||||
{
|
{
|
||||||
uchar* p= (uchar*) to;
|
uchar* p= to;
|
||||||
int ml, i;
|
int ml, i;
|
||||||
*to++ = chr;
|
*to++ = chr;
|
||||||
|
|
||||||
@ -1592,7 +1608,7 @@ int READ_INFO::read_field()
|
|||||||
(const char *)to))
|
(const char *)to))
|
||||||
continue;
|
continue;
|
||||||
for (i= 0; i < ml; i++)
|
for (i= 0; i < ml; i++)
|
||||||
PUSH((uchar) *--to);
|
PUSH(*--to);
|
||||||
chr= GET;
|
chr= GET;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1741,7 +1757,7 @@ bool READ_INFO::find_start_of_fields()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} while ((char) chr != line_start_ptr[0]);
|
} while ((char) chr != line_start_ptr[0]);
|
||||||
for (char *ptr=line_start_ptr+1 ; ptr != line_start_end ; ptr++)
|
for (const char *ptr=line_start_ptr+1 ; ptr != line_start_end ; ptr++)
|
||||||
{
|
{
|
||||||
chr=GET; // Eof will be checked later
|
chr=GET; // Eof will be checked later
|
||||||
if ((char) chr != *ptr)
|
if ((char) chr != *ptr)
|
||||||
@ -1749,7 +1765,7 @@ bool READ_INFO::find_start_of_fields()
|
|||||||
PUSH(chr);
|
PUSH(chr);
|
||||||
while (--ptr != line_start_ptr)
|
while (--ptr != line_start_ptr)
|
||||||
{ // Restart with next char
|
{ // Restart with next char
|
||||||
PUSH((uchar) *ptr);
|
PUSH( *ptr);
|
||||||
}
|
}
|
||||||
goto try_again;
|
goto try_again;
|
||||||
}
|
}
|
||||||
@ -1945,7 +1961,7 @@ int READ_INFO::read_xml()
|
|||||||
|
|
||||||
// row tag should be in ROWS IDENTIFIED BY '<row>' - stored in line_term
|
// row tag should be in ROWS IDENTIFIED BY '<row>' - stored in line_term
|
||||||
if((tag.length() == line_term_length -2) &&
|
if((tag.length() == line_term_length -2) &&
|
||||||
(strncmp(tag.c_ptr_safe(), line_term_ptr + 1, tag.length()) == 0))
|
(memcmp(tag.ptr(), line_term_ptr + 1, tag.length()) == 0))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("read_xml", ("start-of-row: %i %s %s",
|
DBUG_PRINT("read_xml", ("start-of-row: %i %s %s",
|
||||||
level,tag.c_ptr_safe(), line_term_ptr));
|
level,tag.c_ptr_safe(), line_term_ptr));
|
||||||
@ -2007,7 +2023,7 @@ int READ_INFO::read_xml()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if((tag.length() == line_term_length -2) &&
|
if((tag.length() == line_term_length -2) &&
|
||||||
(strncmp(tag.c_ptr_safe(), line_term_ptr + 1, tag.length()) == 0))
|
(memcmp(tag.ptr(), line_term_ptr + 1, tag.length()) == 0))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("read_xml", ("found end-of-row %i %s",
|
DBUG_PRINT("read_xml", ("found end-of-row %i %s",
|
||||||
level, tag.c_ptr_safe()));
|
level, tag.c_ptr_safe()));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2009, 2012, Monty Program Ab.
|
Copyright (c) 2009, 2014, Monty Program Ab.
|
||||||
|
|
||||||
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
|
||||||
@ -3112,10 +3112,38 @@ void calc_sum_of_all_status(STATUS_VAR *to)
|
|||||||
/* This is only used internally, but we need it here as a forward reference */
|
/* This is only used internally, but we need it here as a forward reference */
|
||||||
extern ST_SCHEMA_TABLE schema_tables[];
|
extern ST_SCHEMA_TABLE schema_tables[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
Condition pushdown used for INFORMATION_SCHEMA / SHOW queries.
|
||||||
|
This structure is to implement an optimization when
|
||||||
|
accessing data dictionary data in the INFORMATION_SCHEMA
|
||||||
|
or SHOW commands.
|
||||||
|
When the query contain a TABLE_SCHEMA or TABLE_NAME clause,
|
||||||
|
narrow the search for data based on the constraints given.
|
||||||
|
*/
|
||||||
typedef struct st_lookup_field_values
|
typedef struct st_lookup_field_values
|
||||||
{
|
{
|
||||||
LEX_STRING db_value, table_value;
|
/**
|
||||||
bool wild_db_value, wild_table_value;
|
Value of a TABLE_SCHEMA clause.
|
||||||
|
Note that this value length may exceed @c NAME_LEN.
|
||||||
|
@sa wild_db_value
|
||||||
|
*/
|
||||||
|
LEX_STRING db_value;
|
||||||
|
/**
|
||||||
|
Value of a TABLE_NAME clause.
|
||||||
|
Note that this value length may exceed @c NAME_LEN.
|
||||||
|
@sa wild_table_value
|
||||||
|
*/
|
||||||
|
LEX_STRING table_value;
|
||||||
|
/**
|
||||||
|
True when @c db_value is a LIKE clause,
|
||||||
|
false when @c db_value is an '=' clause.
|
||||||
|
*/
|
||||||
|
bool wild_db_value;
|
||||||
|
/**
|
||||||
|
True when @c table_value is a LIKE clause,
|
||||||
|
false when @c table_value is an '=' clause.
|
||||||
|
*/
|
||||||
|
bool wild_table_value;
|
||||||
} LOOKUP_FIELD_VALUES;
|
} LOOKUP_FIELD_VALUES;
|
||||||
|
|
||||||
|
|
||||||
@ -3520,14 +3548,22 @@ int make_db_list(THD *thd, List<LEX_STRING> *files,
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
If we have db lookup vaule we just add it to list and
|
If we have db lookup value we just add it to list and
|
||||||
exit from the function.
|
exit from the function.
|
||||||
We don't do this for database names longer than the maximum
|
We don't do this for database names longer than the maximum
|
||||||
path length.
|
name length.
|
||||||
*/
|
*/
|
||||||
if (lookup_field_vals->db_value.str &&
|
if (lookup_field_vals->db_value.str)
|
||||||
lookup_field_vals->db_value.length < FN_REFLEN)
|
|
||||||
{
|
{
|
||||||
|
if (lookup_field_vals->db_value.length > NAME_LEN)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Impossible value for a database name,
|
||||||
|
found in a WHERE DATABASE_NAME = 'xxx' clause.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_infoschema_db(lookup_field_vals->db_value.str,
|
if (is_infoschema_db(lookup_field_vals->db_value.str,
|
||||||
lookup_field_vals->db_value.length))
|
lookup_field_vals->db_value.length))
|
||||||
{
|
{
|
||||||
@ -3664,6 +3700,15 @@ make_table_name_list(THD *thd, List<LEX_STRING> *table_names, LEX *lex,
|
|||||||
if (!lookup_field_vals->wild_table_value &&
|
if (!lookup_field_vals->wild_table_value &&
|
||||||
lookup_field_vals->table_value.str)
|
lookup_field_vals->table_value.str)
|
||||||
{
|
{
|
||||||
|
if (lookup_field_vals->table_value.length > NAME_LEN)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
Impossible value for a table name,
|
||||||
|
found in a WHERE TABLE_NAME = 'xxx' clause.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (with_i_schema)
|
if (with_i_schema)
|
||||||
{
|
{
|
||||||
LEX_STRING *name;
|
LEX_STRING *name;
|
||||||
@ -4127,6 +4172,9 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables,
|
|||||||
bzero((char*) &table_list, sizeof(TABLE_LIST));
|
bzero((char*) &table_list, sizeof(TABLE_LIST));
|
||||||
bzero((char*) &tbl, sizeof(TABLE));
|
bzero((char*) &tbl, sizeof(TABLE));
|
||||||
|
|
||||||
|
DBUG_ASSERT(db_name->length <= NAME_LEN);
|
||||||
|
DBUG_ASSERT(table_name->length <= NAME_LEN);
|
||||||
|
|
||||||
if (lower_case_table_names)
|
if (lower_case_table_names)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -4443,6 +4491,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||||||
it.rewind(); /* To get access to new elements in basis list */
|
it.rewind(); /* To get access to new elements in basis list */
|
||||||
while ((db_name= it++))
|
while ((db_name= it++))
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(db_name->length <= NAME_LEN);
|
||||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||||
if (!(check_access(thd, SELECT_ACL, db_name->str,
|
if (!(check_access(thd, SELECT_ACL, db_name->str,
|
||||||
&thd->col_access, NULL, 0, 1) ||
|
&thd->col_access, NULL, 0, 1) ||
|
||||||
@ -4463,6 +4512,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||||||
List_iterator_fast<LEX_STRING> it_files(table_names);
|
List_iterator_fast<LEX_STRING> it_files(table_names);
|
||||||
while ((table_name= it_files++))
|
while ((table_name= it_files++))
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(table_name->length <= NAME_LEN);
|
||||||
restore_record(table, s->default_values);
|
restore_record(table, s->default_values);
|
||||||
table->field[schema_table->idx_field1]->
|
table->field[schema_table->idx_field1]->
|
||||||
store(db_name->str, db_name->length, system_charset_info);
|
store(db_name->str, db_name->length, system_charset_info);
|
||||||
@ -4597,6 +4647,7 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||||||
List_iterator_fast<LEX_STRING> it(db_names);
|
List_iterator_fast<LEX_STRING> it(db_names);
|
||||||
while ((db_name=it++))
|
while ((db_name=it++))
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(db_name->length <= NAME_LEN);
|
||||||
if (with_i_schema) // information schema name is always first in list
|
if (with_i_schema) // information schema name is always first in list
|
||||||
{
|
{
|
||||||
if (store_schema_shemata(thd, table, db_name,
|
if (store_schema_shemata(thd, table, db_name,
|
||||||
|
@ -222,6 +222,42 @@ bool String::needs_conversion(uint32 arg_length,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Checks that the source string can just be copied to the destination string
|
||||||
|
without conversion.
|
||||||
|
Unlike needs_conversion it will require conversion on incoming binary data
|
||||||
|
to ensure the data are verified for vailidity first.
|
||||||
|
|
||||||
|
@param arg_length Length of string to copy.
|
||||||
|
@param from_cs Character set to copy from
|
||||||
|
@param to_cs Character set to copy to
|
||||||
|
|
||||||
|
@return conversion needed
|
||||||
|
*/
|
||||||
|
bool String::needs_conversion_on_storage(uint32 arg_length,
|
||||||
|
CHARSET_INFO *cs_from,
|
||||||
|
CHARSET_INFO *cs_to)
|
||||||
|
{
|
||||||
|
uint32 offset;
|
||||||
|
return (needs_conversion(arg_length, cs_from, cs_to, &offset) ||
|
||||||
|
/* force conversion when storing a binary string */
|
||||||
|
(cs_from == &my_charset_bin &&
|
||||||
|
/* into a non-binary destination */
|
||||||
|
cs_to != &my_charset_bin &&
|
||||||
|
/* and any of the following is true :*/
|
||||||
|
(
|
||||||
|
/* it's a variable length encoding */
|
||||||
|
cs_to->mbminlen != cs_to->mbmaxlen ||
|
||||||
|
/* longer than 2 bytes : neither 1 byte nor ucs2 */
|
||||||
|
cs_to->mbminlen > 2 ||
|
||||||
|
/* and is not a multiple of the char byte size */
|
||||||
|
0 != (arg_length % cs_to->mbmaxlen)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copy a multi-byte character sets with adding leading zeros.
|
Copy a multi-byte character sets with adding leading zeros.
|
||||||
|
|
||||||
|
@ -322,6 +322,9 @@ public:
|
|||||||
static bool needs_conversion(uint32 arg_length,
|
static bool needs_conversion(uint32 arg_length,
|
||||||
CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
|
CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
|
||||||
uint32 *offset);
|
uint32 *offset);
|
||||||
|
static bool needs_conversion_on_storage(uint32 arg_length,
|
||||||
|
CHARSET_INFO *cs_from,
|
||||||
|
CHARSET_INFO *cs_to);
|
||||||
bool copy_aligned(const char *s, uint32 arg_length, uint32 offset,
|
bool copy_aligned(const char *s, uint32 arg_length, uint32 offset,
|
||||||
CHARSET_INFO *cs);
|
CHARSET_INFO *cs);
|
||||||
bool set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs);
|
bool set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2010, 2014, 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
|
||||||
@ -182,12 +182,19 @@ fk_truncate_illegal_if_parent(THD *thd, TABLE *table)
|
|||||||
@param table_ref Table list element for the table to be truncated.
|
@param table_ref Table list element for the table to be truncated.
|
||||||
@param is_tmp_table True if element refers to a temp table.
|
@param is_tmp_table True if element refers to a temp table.
|
||||||
|
|
||||||
@retval 0 Success.
|
@retval TRUNCATE_OK Truncate was successful and statement can be safely
|
||||||
@retval > 0 Error code.
|
binlogged.
|
||||||
|
@retval TRUNCATE_FAILED_BUT_BINLOG Truncate failed but still go ahead with
|
||||||
|
binlogging as in case of non transactional tables
|
||||||
|
partial truncation is possible.
|
||||||
|
|
||||||
|
@retval TRUNCATE_FAILED_SKIP_BINLOG Truncate was not successful hence donot
|
||||||
|
binlong the statement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int Truncate_statement::handler_truncate(THD *thd, TABLE_LIST *table_ref,
|
enum Truncate_statement::truncate_result
|
||||||
bool is_tmp_table)
|
Truncate_statement::handler_truncate(THD *thd, TABLE_LIST *table_ref,
|
||||||
|
bool is_tmp_table)
|
||||||
{
|
{
|
||||||
int error= 0;
|
int error= 0;
|
||||||
uint flags;
|
uint flags;
|
||||||
@ -229,16 +236,30 @@ int Truncate_statement::handler_truncate(THD *thd, TABLE_LIST *table_ref,
|
|||||||
|
|
||||||
/* Open the table as it will handle some required preparations. */
|
/* Open the table as it will handle some required preparations. */
|
||||||
if (open_and_lock_tables(thd, table_ref, FALSE, flags))
|
if (open_and_lock_tables(thd, table_ref, FALSE, flags))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(TRUNCATE_FAILED_SKIP_BINLOG);
|
||||||
|
|
||||||
/* Whether to truncate regardless of foreign keys. */
|
/* Whether to truncate regardless of foreign keys. */
|
||||||
if (! (thd->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS))
|
if (! (thd->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS))
|
||||||
error= fk_truncate_illegal_if_parent(thd, table_ref->table);
|
if (fk_truncate_illegal_if_parent(thd, table_ref->table))
|
||||||
|
DBUG_RETURN(TRUNCATE_FAILED_SKIP_BINLOG);
|
||||||
|
|
||||||
if (!error && (error= table_ref->table->file->ha_truncate()))
|
error= table_ref->table->file->ha_truncate();
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
table_ref->table->file->print_error(error, MYF(0));
|
table_ref->table->file->print_error(error, MYF(0));
|
||||||
|
/*
|
||||||
DBUG_RETURN(error);
|
If truncate method is not implemented then we don't binlog the
|
||||||
|
statement. If truncation has failed in a transactional engine then also we
|
||||||
|
donot binlog the statment. Only in non transactional engine we binlog
|
||||||
|
inspite of errors.
|
||||||
|
*/
|
||||||
|
if (error == HA_ERR_WRONG_COMMAND ||
|
||||||
|
table_ref->table->file->has_transactions())
|
||||||
|
DBUG_RETURN(TRUNCATE_FAILED_SKIP_BINLOG);
|
||||||
|
else
|
||||||
|
DBUG_RETURN(TRUNCATE_FAILED_BUT_BINLOG);
|
||||||
|
}
|
||||||
|
DBUG_RETURN(TRUNCATE_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -473,10 +494,14 @@ bool Truncate_statement::truncate_table(THD *thd, TABLE_LIST *table_ref)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
All effects of a TRUNCATE TABLE operation are committed even if
|
All effects of a TRUNCATE TABLE operation are committed even if
|
||||||
truncation fails. Thus, the query must be written to the binary
|
truncation fails in the case of non transactional tables. Thus, the
|
||||||
log. The only exception is a unimplemented truncate method.
|
query must be written to the binary log. The only exception is a
|
||||||
|
unimplemented truncate method.
|
||||||
*/
|
*/
|
||||||
binlog_stmt= !error || error != HA_ERR_WRONG_COMMAND;
|
if (error == TRUNCATE_OK || error == TRUNCATE_FAILED_BUT_BINLOG)
|
||||||
|
binlog_stmt= true;
|
||||||
|
else
|
||||||
|
binlog_stmt= false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef SQL_TRUNCATE_INCLUDED
|
#ifndef SQL_TRUNCATE_INCLUDED
|
||||||
#define SQL_TRUNCATE_INCLUDED
|
#define SQL_TRUNCATE_INCLUDED
|
||||||
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
/* Copyright (c) 2010, 2014, 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
|
||||||
@ -47,11 +47,17 @@ public:
|
|||||||
bool execute(THD *thd);
|
bool execute(THD *thd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
enum truncate_result{
|
||||||
|
TRUNCATE_OK=0,
|
||||||
|
TRUNCATE_FAILED_BUT_BINLOG,
|
||||||
|
TRUNCATE_FAILED_SKIP_BINLOG
|
||||||
|
};
|
||||||
|
|
||||||
/** Handle locking a base table for truncate. */
|
/** Handle locking a base table for truncate. */
|
||||||
bool lock_table(THD *, TABLE_LIST *, bool *);
|
bool lock_table(THD *, TABLE_LIST *, bool *);
|
||||||
|
|
||||||
/** Truncate table via the handler method. */
|
/** Truncate table via the handler method. */
|
||||||
int handler_truncate(THD *, TABLE_LIST *, bool);
|
enum truncate_result handler_truncate(THD *, TABLE_LIST *, bool);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Optimized delete of all rows by doing a full regenerate of the table.
|
Optimized delete of all rows by doing a full regenerate of the table.
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2004, 2012, Oracle and/or its affiliates
|
Copyright (c) 2004, 2014, Oracle and/or its affiliates
|
||||||
|
Copyright (c) 2010, 2014, SkySQL Ab.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -143,6 +143,7 @@ row_ins_alloc_sys_fields(
|
|||||||
const dict_col_t* col;
|
const dict_col_t* col;
|
||||||
dfield_t* dfield;
|
dfield_t* dfield;
|
||||||
byte* ptr;
|
byte* ptr;
|
||||||
|
uint len;
|
||||||
|
|
||||||
row = node->row;
|
row = node->row;
|
||||||
table = node->table;
|
table = node->table;
|
||||||
@ -151,35 +152,37 @@ row_ins_alloc_sys_fields(
|
|||||||
ut_ad(row && table && heap);
|
ut_ad(row && table && heap);
|
||||||
ut_ad(dtuple_get_n_fields(row) == dict_table_get_n_cols(table));
|
ut_ad(dtuple_get_n_fields(row) == dict_table_get_n_cols(table));
|
||||||
|
|
||||||
/* 1. Allocate buffer for row id */
|
/* allocate buffer to hold the needed system created hidden columns. */
|
||||||
|
len = DATA_ROW_ID_LEN + DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN;
|
||||||
|
ptr = mem_heap_zalloc(heap, len);
|
||||||
|
|
||||||
|
/* 1. Populate row-id */
|
||||||
col = dict_table_get_sys_col(table, DATA_ROW_ID);
|
col = dict_table_get_sys_col(table, DATA_ROW_ID);
|
||||||
|
|
||||||
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
|
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
|
||||||
|
|
||||||
ptr = mem_heap_zalloc(heap, DATA_ROW_ID_LEN);
|
|
||||||
|
|
||||||
dfield_set_data(dfield, ptr, DATA_ROW_ID_LEN);
|
dfield_set_data(dfield, ptr, DATA_ROW_ID_LEN);
|
||||||
|
|
||||||
node->row_id_buf = ptr;
|
node->row_id_buf = ptr;
|
||||||
|
|
||||||
/* 3. Allocate buffer for trx id */
|
ptr += DATA_ROW_ID_LEN;
|
||||||
|
|
||||||
|
/* 2. Populate trx id */
|
||||||
col = dict_table_get_sys_col(table, DATA_TRX_ID);
|
col = dict_table_get_sys_col(table, DATA_TRX_ID);
|
||||||
|
|
||||||
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
|
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
|
||||||
ptr = mem_heap_zalloc(heap, DATA_TRX_ID_LEN);
|
|
||||||
|
|
||||||
dfield_set_data(dfield, ptr, DATA_TRX_ID_LEN);
|
dfield_set_data(dfield, ptr, DATA_TRX_ID_LEN);
|
||||||
|
|
||||||
node->trx_id_buf = ptr;
|
node->trx_id_buf = ptr;
|
||||||
|
|
||||||
/* 4. Allocate buffer for roll ptr */
|
ptr += DATA_TRX_ID_LEN;
|
||||||
|
|
||||||
|
/* 3. Populate roll ptr */
|
||||||
|
|
||||||
col = dict_table_get_sys_col(table, DATA_ROLL_PTR);
|
col = dict_table_get_sys_col(table, DATA_ROLL_PTR);
|
||||||
|
|
||||||
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
|
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
|
||||||
ptr = mem_heap_zalloc(heap, DATA_ROLL_PTR_LEN);
|
|
||||||
|
|
||||||
dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN);
|
dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user