Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable
This commit is contained in:
parent
fd17d75923
commit
29fd1f2fd9
@ -343,18 +343,6 @@ GROUP_CONCAT(b ORDER BY b)
|
|||||||
First Row
|
First Row
|
||||||
Second Row
|
Second Row
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
INSERT INTO t1 VALUES (1),(2),(3);
|
|
||||||
CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
|
|
||||||
CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
|
|
||||||
SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
|
|
||||||
a_id b_list
|
|
||||||
1 1,2,3
|
|
||||||
2 4,5
|
|
||||||
3 NULL
|
|
||||||
DROP TABLE t2;
|
|
||||||
DROP TABLE t1;
|
|
||||||
CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID));
|
CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID));
|
||||||
INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ');
|
INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ');
|
||||||
CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC));
|
CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC));
|
||||||
@ -462,15 +450,28 @@ SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
|
|||||||
gc
|
gc
|
||||||
NULL
|
NULL
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
create table r2 (a int, b int);
|
create table t2 (a int, b int);
|
||||||
insert into r2 values (1,1), (2,2);
|
insert into t2 values (1,1), (2,2);
|
||||||
select b x, (select group_concat(x) from r2) from r2;
|
select b x, (select group_concat(x) from t2) from t2;
|
||||||
x (select group_concat(x) from r2)
|
x (select group_concat(x) from t2)
|
||||||
1 1,1
|
1 1,1
|
||||||
2 2,2
|
2 2,2
|
||||||
drop table r2;
|
drop table t2;
|
||||||
create table t1 (d int, a int, b int, c int);
|
create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int);
|
||||||
insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
|
insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
|
||||||
|
select d,a,b from t1 order by a;
|
||||||
|
d a b
|
||||||
|
1 1 3
|
||||||
|
2 1 4
|
||||||
|
3 1 2
|
||||||
|
5 1 1
|
||||||
|
6 1 2
|
||||||
|
4 2 7
|
||||||
|
7 2 3
|
||||||
|
8 2 3
|
||||||
|
explain select a, group_concat(b) from t1 group by a with rollup;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using filesort
|
||||||
select a, group_concat(b) from t1 group by a with rollup;
|
select a, group_concat(b) from t1 group by a with rollup;
|
||||||
a group_concat(b)
|
a group_concat(b)
|
||||||
1 3,4,2,1,2
|
1 3,4,2,1,2
|
||||||
|
@ -1647,3 +1647,15 @@ CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
|
|||||||
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
|
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
|
||||||
ERROR HY000: The used table type doesn't support FULLTEXT indexes
|
ERROR HY000: The used table type doesn't support FULLTEXT indexes
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
INSERT INTO t1 VALUES (1),(2),(3);
|
||||||
|
CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
|
||||||
|
CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
|
||||||
|
SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
|
||||||
|
a_id b_list
|
||||||
|
1 1,2,3
|
||||||
|
2 4,5
|
||||||
|
3 NULL
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -83,7 +83,7 @@ TV NULL NULL 600
|
|||||||
NULL NULL NULL 7785
|
NULL NULL NULL 7785
|
||||||
explain extended select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup;
|
explain extended select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using temporary; Using filesort
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 15 Using filesort
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup
|
Note 1003 select test.t1.product AS `product`,test.t1.country_id AS `country_id`,test.t1.year AS `year`,sum(test.t1.profit) AS `sum(profit)` from test.t1 group by test.t1.product,test.t1.country_id,test.t1.year with rollup
|
||||||
select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup;
|
select product, country_id , sum(profit) from t1 group by product desc, country_id with rollup;
|
||||||
|
@ -213,21 +213,6 @@ INSERT INTO t1 VALUES (1,'First Row'), (2,'Second Row');
|
|||||||
SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a;
|
SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
|
||||||
# check null values #1
|
|
||||||
#
|
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
INSERT INTO t1 VALUES (1),(2),(3);
|
|
||||||
CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
|
|
||||||
CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
--enable_warnings
|
|
||||||
INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
|
|
||||||
SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
|
|
||||||
DROP TABLE t2;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# check null values #2
|
# check null values #2
|
||||||
#
|
#
|
||||||
@ -288,17 +273,19 @@ DROP TABLE t1;
|
|||||||
#
|
#
|
||||||
# Bug #8656: Crash with group_concat on alias in outer table
|
# Bug #8656: Crash with group_concat on alias in outer table
|
||||||
#
|
#
|
||||||
create table r2 (a int, b int);
|
create table t2 (a int, b int);
|
||||||
insert into r2 values (1,1), (2,2);
|
insert into t2 values (1,1), (2,2);
|
||||||
select b x, (select group_concat(x) from r2) from r2;
|
select b x, (select group_concat(x) from t2) from t2;
|
||||||
drop table r2;
|
drop table t2;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug #7405: problems with rollup
|
# Bug #7405: problems with rollup
|
||||||
#
|
#
|
||||||
|
|
||||||
create table t1 (d int, a int, b int, c int);
|
create table t1 (d int not null auto_increment,primary key(d), a int, b int, c int);
|
||||||
insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
|
insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
|
||||||
|
select d,a,b from t1 order by a;
|
||||||
|
explain select a, group_concat(b) from t1 group by a with rollup;
|
||||||
select a, group_concat(b) from t1 group by a with rollup;
|
select a, group_concat(b) from t1 group by a with rollup;
|
||||||
select a, group_concat(distinct b) from t1 group by a with rollup;
|
select a, group_concat(distinct b) from t1 group by a with rollup;
|
||||||
select a, group_concat(b order by b) from t1 group by a with rollup;
|
select a, group_concat(b order by b) from t1 group by a with rollup;
|
||||||
|
@ -1187,3 +1187,18 @@ CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
|
|||||||
--error 1214;
|
--error 1214;
|
||||||
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
|
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# check null values #1
|
||||||
|
#
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
INSERT INTO t1 VALUES (1),(2),(3);
|
||||||
|
CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
|
||||||
|
CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
--enable_warnings
|
||||||
|
INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
|
||||||
|
SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -19,13 +19,10 @@
|
|||||||
** This file implements classes defined in field.h
|
** This file implements classes defined in field.h
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "sql_select.h"
|
#include "sql_select.h"
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -47,13 +47,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#ifdef HAVE_BERKELEY_DB
|
#ifdef HAVE_BERKELEY_DB
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <myisampack.h>
|
#include <myisampack.h>
|
||||||
|
@ -15,13 +15,10 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
|
||||||
#pragma implementation // gcc: Class implementation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
|
#pragma implementation // gcc: Class implementation
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_BLACKHOLE_DB
|
#ifdef HAVE_BLACKHOLE_DB
|
||||||
#include "ha_blackhole.h"
|
#include "ha_blackhole.h"
|
||||||
|
@ -15,13 +15,10 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <myisampack.h>
|
#include <myisampack.h>
|
||||||
#include "ha_heap.h"
|
#include "ha_heap.h"
|
||||||
|
|
||||||
|
@ -28,13 +28,10 @@ have disables the InnoDB inlining in this file. */
|
|||||||
in Windows?
|
in Windows?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "slave.h"
|
#include "slave.h"
|
||||||
|
|
||||||
#ifdef HAVE_INNOBASE_DB
|
#ifdef HAVE_INNOBASE_DB
|
||||||
|
@ -14,14 +14,10 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
|
||||||
#pragma implementation // gcc: Class implementation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
|
#pragma implementation // gcc: Class implementation
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ISAM
|
#ifdef HAVE_ISAM
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <myisampack.h>
|
#include <myisampack.h>
|
||||||
|
@ -15,13 +15,10 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#ifdef HAVE_ISAM
|
#ifdef HAVE_ISAM
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#ifndef MASTER
|
#ifndef MASTER
|
||||||
|
@ -15,13 +15,10 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <myisampack.h>
|
#include <myisampack.h>
|
||||||
#include "ha_myisam.h"
|
#include "ha_myisam.h"
|
||||||
|
@ -15,13 +15,10 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include "ha_myisammrg.h"
|
#include "ha_myisammrg.h"
|
||||||
#ifndef MASTER
|
#ifndef MASTER
|
||||||
|
@ -20,13 +20,10 @@
|
|||||||
NDB Cluster
|
NDB Cluster
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
|
||||||
#pragma implementation // gcc: Class implementation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
|
#pragma implementation // gcc: Class implementation
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NDBCLUSTER_DB
|
#ifdef HAVE_NDBCLUSTER_DB
|
||||||
#include <my_dir.h>
|
#include <my_dir.h>
|
||||||
|
@ -17,13 +17,10 @@
|
|||||||
|
|
||||||
/* Handler-calling-functions */
|
/* Handler-calling-functions */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "ha_heap.h"
|
#include "ha_heap.h"
|
||||||
#include "ha_myisam.h"
|
#include "ha_myisam.h"
|
||||||
#include "ha_myisammrg.h"
|
#include "ha_myisammrg.h"
|
||||||
|
@ -20,11 +20,8 @@
|
|||||||
** to usage.
|
** to usage.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "hash_filo.h"
|
#include "hash_filo.h"
|
||||||
|
@ -15,13 +15,10 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include "my_dir.h"
|
#include "my_dir.h"
|
||||||
|
|
||||||
|
@ -17,13 +17,10 @@
|
|||||||
|
|
||||||
/* This file defines all compare functions */
|
/* This file defines all compare functions */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include "sql_select.h"
|
#include "sql_select.h"
|
||||||
|
|
||||||
|
@ -17,13 +17,10 @@
|
|||||||
|
|
||||||
/* This file defines all numerical functions */
|
/* This file defines all numerical functions */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "slave.h" // for wait_for_master_pos
|
#include "slave.h" // for wait_for_master_pos
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
@ -1491,9 +1488,6 @@ longlong Item_func_field::val_int()
|
|||||||
{
|
{
|
||||||
DBUG_ASSERT(fixed == 1);
|
DBUG_ASSERT(fixed == 1);
|
||||||
|
|
||||||
if (args[0]->null_value)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (cmp_type == STRING_RESULT)
|
if (cmp_type == STRING_RESULT)
|
||||||
{
|
{
|
||||||
String *field;
|
String *field;
|
||||||
@ -1509,18 +1503,22 @@ longlong Item_func_field::val_int()
|
|||||||
else if (cmp_type == INT_RESULT)
|
else if (cmp_type == INT_RESULT)
|
||||||
{
|
{
|
||||||
longlong val= args[0]->val_int();
|
longlong val= args[0]->val_int();
|
||||||
|
if (args[0]->null_value)
|
||||||
|
return 0;
|
||||||
for (uint i=1; i < arg_count ; i++)
|
for (uint i=1; i < arg_count ; i++)
|
||||||
{
|
{
|
||||||
if (!args[i]->null_value && val == args[i]->val_int())
|
if (val == args[i]->val_int() && !args[i]->null_value)
|
||||||
return (longlong) (i);
|
return (longlong) (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double val= args[0]->val();
|
double val= args[0]->val();
|
||||||
|
if (args[0]->null_value)
|
||||||
|
return 0;
|
||||||
for (uint i=1; i < arg_count ; i++)
|
for (uint i=1; i < arg_count ; i++)
|
||||||
{
|
{
|
||||||
if (!args[i]->null_value && val == args[i]->val())
|
if (val == args[i]->val() && !args[i]->null_value)
|
||||||
return (longlong) (i);
|
return (longlong) (i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,11 @@
|
|||||||
|
|
||||||
/* This file defines all spatial functions */
|
/* This file defines all spatial functions */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_SPATIAL
|
#ifdef HAVE_SPATIAL
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
|
|
||||||
|
@ -20,13 +20,10 @@
|
|||||||
** (This shouldn't be needed)
|
** (This shouldn't be needed)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
#include <openssl/des.h>
|
#include <openssl/des.h>
|
||||||
|
@ -22,13 +22,10 @@ SUBSELECT TODO:
|
|||||||
(sql_select.h/sql_select.cc)
|
(sql_select.h/sql_select.cc)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "sql_select.h"
|
#include "sql_select.h"
|
||||||
|
|
||||||
inline Item * and_items(Item* cond, Item *item)
|
inline Item * and_items(Item* cond, Item *item)
|
||||||
|
@ -17,14 +17,11 @@
|
|||||||
|
|
||||||
/* Sum functions (COUNT, MIN...) */
|
/* Sum functions (COUNT, MIN...) */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
|
|
||||||
Item_sum::Item_sum(List<Item> &list)
|
Item_sum::Item_sum(List<Item> &list)
|
||||||
:arg_count(list.elements)
|
:arg_count(list.elements)
|
||||||
{
|
{
|
||||||
|
@ -17,13 +17,10 @@
|
|||||||
|
|
||||||
/* This file defines all time functions */
|
/* This file defines all time functions */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
@ -16,10 +16,7 @@
|
|||||||
|
|
||||||
/* Compability file */
|
/* Compability file */
|
||||||
|
|
||||||
#include <my_global.h>
|
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
|
||||||
#pragma implementation
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
|
#pragma implementation // gcc: Class implementation
|
||||||
|
#endif
|
||||||
|
@ -17,12 +17,10 @@
|
|||||||
|
|
||||||
#ifndef MYSQL_CLIENT
|
#ifndef MYSQL_CLIENT
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "slave.h"
|
#include "slave.h"
|
||||||
#include <my_dir.h>
|
#include <my_dir.h>
|
||||||
#endif /* MYSQL_CLIENT */
|
#endif /* MYSQL_CLIENT */
|
||||||
|
@ -37,7 +37,7 @@ typedef ulong key_part_map; /* Used for finding key parts */
|
|||||||
|
|
||||||
/* useful constants */
|
/* useful constants */
|
||||||
extern const key_map key_map_empty;
|
extern const key_map key_map_empty;
|
||||||
extern const key_map key_map_full;
|
extern key_map key_map_full; /* Should be threaded as const */
|
||||||
extern const char *primary_key_name;
|
extern const char *primary_key_name;
|
||||||
|
|
||||||
#include "mysql_com.h"
|
#include "mysql_com.h"
|
||||||
|
@ -351,6 +351,9 @@ char mysql_real_data_home[FN_REFLEN],
|
|||||||
*opt_init_connect, *opt_init_slave,
|
*opt_init_connect, *opt_init_slave,
|
||||||
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
|
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
|
||||||
|
|
||||||
|
const key_map key_map_empty(0);
|
||||||
|
key_map key_map_full(0); // Will be initialized later
|
||||||
|
|
||||||
const char *opt_date_time_formats[3];
|
const char *opt_date_time_formats[3];
|
||||||
|
|
||||||
char *language_ptr, *default_collation_name, *default_character_set_name;
|
char *language_ptr, *default_collation_name, *default_character_set_name;
|
||||||
@ -5677,6 +5680,7 @@ static void mysql_init_variables(void)
|
|||||||
mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
|
mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
|
||||||
bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
|
bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
|
||||||
bzero((gptr) &com_stat, sizeof(com_stat));
|
bzero((gptr) &com_stat, sizeof(com_stat));
|
||||||
|
key_map_full.set_all();
|
||||||
|
|
||||||
/* Character sets */
|
/* Character sets */
|
||||||
system_charset_info= &my_charset_utf8_general_ci;
|
system_charset_info= &my_charset_utf8_general_ci;
|
||||||
|
@ -23,13 +23,10 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <nisam.h>
|
#include <nisam.h>
|
||||||
#include "sql_select.h"
|
#include "sql_select.h"
|
||||||
|
@ -143,10 +143,14 @@ class SQL_SELECT :public Sql_alloc {
|
|||||||
~SQL_SELECT();
|
~SQL_SELECT();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
bool check_quick(THD *thd, bool force_quick_range, ha_rows limit)
|
bool check_quick(THD *thd, bool force_quick_range, ha_rows limit)
|
||||||
{ return test_quick_select(thd, key_map(~(uint)0), 0, limit, force_quick_range) < 0; }
|
{
|
||||||
|
key_map tmp;
|
||||||
|
tmp.set_all();
|
||||||
|
return test_quick_select(thd, tmp, 0, limit, force_quick_range) < 0;
|
||||||
|
}
|
||||||
inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; }
|
inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; }
|
||||||
int test_quick_select(THD *thd, key_map keys, table_map prev_tables,
|
int test_quick_select(THD *thd, key_map keys, table_map prev_tables,
|
||||||
ha_rows limit, bool force_quick_range=0);
|
ha_rows limit, bool force_quick_range);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,13 +17,10 @@
|
|||||||
|
|
||||||
/* Procedures (functions with changes output of select) */
|
/* Procedures (functions with changes output of select) */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "procedure.h"
|
#include "procedure.h"
|
||||||
#include "sql_analyse.h" // Includes procedure
|
#include "sql_analyse.h" // Includes procedure
|
||||||
#ifdef USE_PROC_RANGE
|
#ifdef USE_PROC_RANGE
|
||||||
|
@ -19,13 +19,10 @@
|
|||||||
The actual communction is handled by the net_xxx functions in net_serv.cc
|
The actual communction is handled by the net_xxx functions in net_serv.cc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
|
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
|
||||||
|
@ -19,13 +19,10 @@
|
|||||||
The actual communction is handled by the net_xxx functions in net_serv.cc
|
The actual communction is handled by the net_xxx functions in net_serv.cc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
|
|
||||||
bool Protocol_cursor::send_fields(List<Item> *list, uint flag)
|
bool Protocol_cursor::send_fields(List<Item> *list, uint flag)
|
||||||
|
@ -48,13 +48,10 @@
|
|||||||
new attribute.
|
new attribute.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
#include "slave.h"
|
#include "slave.h"
|
||||||
#include <my_getopt.h>
|
#include <my_getopt.h>
|
||||||
|
@ -23,13 +23,10 @@
|
|||||||
** - type set is out of optimization yet
|
** - type set is out of optimization yet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "procedure.h"
|
#include "procedure.h"
|
||||||
#include "sql_analyse.h"
|
#include "sql_analyse.h"
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
|
@ -22,13 +22,10 @@
|
|||||||
**
|
**
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <thr_alarm.h>
|
#include <thr_alarm.h>
|
||||||
|
@ -23,14 +23,11 @@
|
|||||||
needs something like 'ssh'.
|
needs something like 'ssh'.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
|
|
||||||
SQL_CRYPT::SQL_CRYPT(const char *password)
|
SQL_CRYPT::SQL_CRYPT(const char *password)
|
||||||
{
|
{
|
||||||
ulong rand_nr[2];
|
ulong rand_nr[2];
|
||||||
|
@ -752,7 +752,7 @@ public:
|
|||||||
volatile bool status,dead;
|
volatile bool status,dead;
|
||||||
COPY_INFO info;
|
COPY_INFO info;
|
||||||
I_List<delayed_row> rows;
|
I_List<delayed_row> rows;
|
||||||
uint group_count;
|
ulong group_count;
|
||||||
TABLE_LIST table_list; // Argument
|
TABLE_LIST table_list; // Argument
|
||||||
|
|
||||||
delayed_insert()
|
delayed_insert()
|
||||||
@ -1420,7 +1420,7 @@ static void free_delayed_insert_blobs(register TABLE *table)
|
|||||||
bool delayed_insert::handle_inserts(void)
|
bool delayed_insert::handle_inserts(void)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
uint max_rows;
|
ulong max_rows;
|
||||||
bool using_ignore=0, using_bin_log=mysql_bin_log.is_open();
|
bool using_ignore=0, using_bin_log=mysql_bin_log.is_open();
|
||||||
delayed_row *row;
|
delayed_row *row;
|
||||||
DBUG_ENTER("handle_inserts");
|
DBUG_ENTER("handle_inserts");
|
||||||
@ -1439,11 +1439,11 @@ bool delayed_insert::handle_inserts(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
thd.proc_info="insert";
|
thd.proc_info="insert";
|
||||||
max_rows=delayed_insert_limit;
|
max_rows= delayed_insert_limit;
|
||||||
if (thd.killed || table->version != refresh_version)
|
if (thd.killed || table->version != refresh_version)
|
||||||
{
|
{
|
||||||
thd.killed=1;
|
thd.killed=1;
|
||||||
max_rows= ~(uint)0; // Do as much as possible
|
max_rows= ~(ulong)0; // Do as much as possible
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -15,14 +15,11 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
|
|
||||||
list_node end_of_list;
|
list_node end_of_list;
|
||||||
|
|
||||||
void free_list(I_List <i_string_pair> *list)
|
void free_list(I_List <i_string_pair> *list)
|
||||||
|
@ -15,13 +15,10 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -28,13 +28,10 @@
|
|||||||
|
|
||||||
#ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1
|
#ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "sql_select.h"
|
#include "sql_select.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,13 +17,10 @@
|
|||||||
|
|
||||||
/* mysql_select and join optimization */
|
/* mysql_select and join optimization */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include "mysql_priv.h"
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
|
||||||
#include "sql_select.h"
|
#include "sql_select.h"
|
||||||
|
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
@ -35,9 +32,6 @@ const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref",
|
|||||||
"ref_or_null","unique_subquery","index_subquery"
|
"ref_or_null","unique_subquery","index_subquery"
|
||||||
};
|
};
|
||||||
|
|
||||||
const key_map key_map_empty(0);
|
|
||||||
const key_map key_map_full(~(uint)0);
|
|
||||||
|
|
||||||
static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array);
|
static void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array);
|
||||||
static bool make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
|
static bool make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
|
||||||
DYNAMIC_ARRAY *keyuse);
|
DYNAMIC_ARRAY *keyuse);
|
||||||
@ -66,7 +60,7 @@ static bool only_eq_ref_tables(JOIN *join, ORDER *order, table_map tables);
|
|||||||
static void update_depend_map(JOIN *join);
|
static void update_depend_map(JOIN *join);
|
||||||
static void update_depend_map(JOIN *join, ORDER *order);
|
static void update_depend_map(JOIN *join, ORDER *order);
|
||||||
static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond,
|
static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond,
|
||||||
bool *simple_order);
|
bool change_list, bool *simple_order);
|
||||||
static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables,
|
static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables,
|
||||||
List<Item> &fields, bool send_row,
|
List<Item> &fields, bool send_row,
|
||||||
uint select_options, const char *info,
|
uint select_options, const char *info,
|
||||||
@ -613,7 +607,7 @@ JOIN::optimize()
|
|||||||
/* Optimize distinct away if possible */
|
/* Optimize distinct away if possible */
|
||||||
{
|
{
|
||||||
ORDER *org_order= order;
|
ORDER *org_order= order;
|
||||||
order=remove_const(this, order,conds,&simple_order);
|
order=remove_const(this, order,conds,1, &simple_order);
|
||||||
/*
|
/*
|
||||||
If we are using ORDER BY NULL or ORDER BY const_expression,
|
If we are using ORDER BY NULL or ORDER BY const_expression,
|
||||||
return result in any order (even if we are using a GROUP BY)
|
return result in any order (even if we are using a GROUP BY)
|
||||||
@ -681,8 +675,9 @@ JOIN::optimize()
|
|||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
simple_group= 0;
|
simple_group= 0;
|
||||||
if (rollup.state == ROLLUP::STATE_NONE)
|
group_list= remove_const(this, group_list, conds,
|
||||||
group_list= remove_const(this, group_list, conds, &simple_group);
|
rollup.state == ROLLUP::STATE_NONE,
|
||||||
|
&simple_group);
|
||||||
if (!group_list && group)
|
if (!group_list && group)
|
||||||
{
|
{
|
||||||
order=0; // The output has only one row
|
order=0; // The output has only one row
|
||||||
@ -694,7 +689,7 @@ JOIN::optimize()
|
|||||||
if (procedure && procedure->group)
|
if (procedure && procedure->group)
|
||||||
{
|
{
|
||||||
group_list= procedure->group= remove_const(this, procedure->group, conds,
|
group_list= procedure->group= remove_const(this, procedure->group, conds,
|
||||||
&simple_group);
|
1, &simple_group);
|
||||||
calc_group_buffer(this, group_list);
|
calc_group_buffer(this, group_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1638,8 +1633,8 @@ static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select,
|
|||||||
{
|
{
|
||||||
select->head=table;
|
select->head=table;
|
||||||
table->reginfo.impossible_range=0;
|
table->reginfo.impossible_range=0;
|
||||||
if ((error=select->test_quick_select(thd, *(key_map *)keys,(table_map) 0,
|
if ((error= select->test_quick_select(thd, *(key_map *)keys,(table_map) 0,
|
||||||
limit)) == 1)
|
limit, 0)) == 1)
|
||||||
DBUG_RETURN(select->quick->records);
|
DBUG_RETURN(select->quick->records);
|
||||||
if (error == -1)
|
if (error == -1)
|
||||||
{
|
{
|
||||||
@ -3452,7 +3447,8 @@ make_simple_join(JOIN *join,TABLE *tmp_table)
|
|||||||
join_tab->select_cond=0;
|
join_tab->select_cond=0;
|
||||||
join_tab->quick=0;
|
join_tab->quick=0;
|
||||||
join_tab->type= JT_ALL; /* Map through all records */
|
join_tab->type= JT_ALL; /* Map through all records */
|
||||||
join_tab->keys.init(~(uint)0); /* test everything in quick */
|
join_tab->keys.init();
|
||||||
|
join_tab->keys.set_all(); /* test everything in quick */
|
||||||
join_tab->info=0;
|
join_tab->info=0;
|
||||||
join_tab->on_expr=0;
|
join_tab->on_expr=0;
|
||||||
join_tab->ref.key = -1;
|
join_tab->ref.key = -1;
|
||||||
@ -3684,7 +3680,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
|
|||||||
(join->select_options &
|
(join->select_options &
|
||||||
OPTION_FOUND_ROWS ?
|
OPTION_FOUND_ROWS ?
|
||||||
HA_POS_ERROR :
|
HA_POS_ERROR :
|
||||||
join->unit->select_limit_cnt)) < 0)
|
join->unit->select_limit_cnt), 0) < 0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Before reporting "Impossible WHERE" for the whole query
|
Before reporting "Impossible WHERE" for the whole query
|
||||||
@ -3697,7 +3693,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
|
|||||||
(join->select_options &
|
(join->select_options &
|
||||||
OPTION_FOUND_ROWS ?
|
OPTION_FOUND_ROWS ?
|
||||||
HA_POS_ERROR :
|
HA_POS_ERROR :
|
||||||
join->unit->select_limit_cnt)) < 0)
|
join->unit->select_limit_cnt),0) < 0)
|
||||||
DBUG_RETURN(1); // Impossible WHERE
|
DBUG_RETURN(1); // Impossible WHERE
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4200,20 +4196,39 @@ static void update_depend_map(JOIN *join, ORDER *order)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
simple_order is set to 1 if sort_order only uses fields from head table
|
Remove all constants and check if ORDER only contains simple expressions
|
||||||
and the head table is not a LEFT JOIN table
|
|
||||||
|
SYNOPSIS
|
||||||
|
remove_const()
|
||||||
|
join Join handler
|
||||||
|
first_order List of SORT or GROUP order
|
||||||
|
cond WHERE statement
|
||||||
|
change_list Set to 1 if we should remove things from list
|
||||||
|
If this is not set, then only simple_order is
|
||||||
|
calculated
|
||||||
|
simple_order Set to 1 if we are only using simple expressions
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
Returns new sort order
|
||||||
|
|
||||||
|
simple_order is set to 1 if sort_order only uses fields from head table
|
||||||
|
and the head table is not a LEFT JOIN table
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static ORDER *
|
static ORDER *
|
||||||
remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order)
|
remove_const(JOIN *join,ORDER *first_order, COND *cond,
|
||||||
|
bool change_list, bool *simple_order)
|
||||||
{
|
{
|
||||||
if (join->tables == join->const_tables)
|
if (join->tables == join->const_tables)
|
||||||
return 0; // No need to sort
|
return change_list ? 0 : first_order; // No need to sort
|
||||||
DBUG_ENTER("remove_const");
|
|
||||||
ORDER *order,**prev_ptr;
|
ORDER *order,**prev_ptr;
|
||||||
table_map first_table= join->join_tab[join->const_tables].table->map;
|
table_map first_table= join->join_tab[join->const_tables].table->map;
|
||||||
table_map not_const_tables= ~join->const_table_map;
|
table_map not_const_tables= ~join->const_table_map;
|
||||||
table_map ref;
|
table_map ref;
|
||||||
|
DBUG_ENTER("remove_const");
|
||||||
|
|
||||||
prev_ptr= &first_order;
|
prev_ptr= &first_order;
|
||||||
*simple_order= join->join_tab[join->const_tables].on_expr ? 0 : 1;
|
*simple_order= join->join_tab[join->const_tables].on_expr ? 0 : 1;
|
||||||
|
|
||||||
@ -4244,7 +4259,8 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order)
|
|||||||
}
|
}
|
||||||
if ((ref=order_tables & (not_const_tables ^ first_table)))
|
if ((ref=order_tables & (not_const_tables ^ first_table)))
|
||||||
{
|
{
|
||||||
if (!(order_tables & first_table) && only_eq_ref_tables(join,first_order,ref))
|
if (!(order_tables & first_table) &&
|
||||||
|
only_eq_ref_tables(join,first_order, ref))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info",("removing: %s", order->item[0]->full_name()));
|
DBUG_PRINT("info",("removing: %s", order->item[0]->full_name()));
|
||||||
continue;
|
continue;
|
||||||
@ -4253,11 +4269,13 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond, bool *simple_order)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*prev_ptr= order; // use this entry
|
if (change_list)
|
||||||
|
*prev_ptr= order; // use this entry
|
||||||
prev_ptr= &order->next;
|
prev_ptr= &order->next;
|
||||||
}
|
}
|
||||||
*prev_ptr=0;
|
if (change_list)
|
||||||
if (!first_order) // Nothing to sort/group
|
*prev_ptr=0;
|
||||||
|
if (prev_ptr == &first_order) // Nothing to sort/group
|
||||||
*simple_order=1;
|
*simple_order=1;
|
||||||
DBUG_PRINT("exit",("simple_order: %d",(int) *simple_order));
|
DBUG_PRINT("exit",("simple_order: %d",(int) *simple_order));
|
||||||
DBUG_RETURN(first_order);
|
DBUG_RETURN(first_order);
|
||||||
@ -6357,7 +6375,7 @@ test_if_quick_select(JOIN_TAB *tab)
|
|||||||
delete tab->select->quick;
|
delete tab->select->quick;
|
||||||
tab->select->quick=0;
|
tab->select->quick=0;
|
||||||
return tab->select->test_quick_select(tab->join->thd, tab->keys,
|
return tab->select->test_quick_select(tab->join->thd, tab->keys,
|
||||||
(table_map) 0, HA_POS_ERROR);
|
(table_map) 0, HA_POS_ERROR, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -7352,12 +7370,15 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
|
|||||||
parameres are set correctly by the range optimizer.
|
parameres are set correctly by the range optimizer.
|
||||||
*/
|
*/
|
||||||
key_map new_ref_key_map;
|
key_map new_ref_key_map;
|
||||||
new_ref_key_map.clear_all(); /* Force the creation of quick select */
|
new_ref_key_map.clear_all(); // Force the creation of quick select
|
||||||
new_ref_key_map.set_bit(new_ref_key); /* only for new_ref_key. */
|
new_ref_key_map.set_bit(new_ref_key); // only for new_ref_key.
|
||||||
|
|
||||||
if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0,
|
if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0,
|
||||||
(tab->join->select_options & OPTION_FOUND_ROWS) ?
|
(tab->join->select_options &
|
||||||
HA_POS_ERROR : tab->join->unit->select_limit_cnt) <= 0)
|
OPTION_FOUND_ROWS) ?
|
||||||
|
HA_POS_ERROR :
|
||||||
|
tab->join->unit->select_limit_cnt,0) <=
|
||||||
|
0)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
ref_key= new_ref_key;
|
ref_key= new_ref_key;
|
||||||
@ -8902,6 +8923,8 @@ bool JOIN::make_sum_func_list(List<Item> &field_list, List<Item> &send_fields,
|
|||||||
for (uint i=0 ; i <= send_group_parts ;i++)
|
for (uint i=0 ; i <= send_group_parts ;i++)
|
||||||
sum_funcs_end[i]= func;
|
sum_funcs_end[i]= func;
|
||||||
}
|
}
|
||||||
|
else if (rollup.state == ROLLUP::STATE_READY)
|
||||||
|
DBUG_RETURN(FALSE); // Don't put end marker
|
||||||
*func=0; // End marker
|
*func=0; // End marker
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
@ -9415,9 +9438,10 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
|
|||||||
This is an element that is used by the GROUP BY and should be
|
This is an element that is used by the GROUP BY and should be
|
||||||
set to NULL in this level
|
set to NULL in this level
|
||||||
*/
|
*/
|
||||||
|
Item_null_result *null_item;
|
||||||
item->maybe_null= 1; // Value will be null sometimes
|
item->maybe_null= 1; // Value will be null sometimes
|
||||||
Item_null_result *null_item= rollup.null_items[i];
|
null_item= rollup.null_items[i];
|
||||||
null_item->result_field= ((Item_field *) item)->result_field;
|
null_item->result_field= item->get_tmp_table_field();
|
||||||
item= null_item;
|
item= null_item;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -17,11 +17,9 @@
|
|||||||
/* This file is originally from the mysql distribution. Coded by monty */
|
/* This file is originally from the mysql distribution. Coded by monty */
|
||||||
|
|
||||||
#include <my_global.h>
|
#include <my_global.h>
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
#pragma implementation // gcc: Class implementation
|
#pragma implementation // gcc: Class implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <my_sys.h>
|
#include <my_sys.h>
|
||||||
#include <m_string.h>
|
#include <m_string.h>
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
|
@ -325,7 +325,7 @@ int quick_rm_table(enum db_type base,const char *db,
|
|||||||
build_table_path(path, sizeof(path), db, table_name, reg_ext);
|
build_table_path(path, sizeof(path), db, table_name, reg_ext);
|
||||||
if (my_delete(path,MYF(0)))
|
if (my_delete(path,MYF(0)))
|
||||||
error=1; /* purecov: inspected */
|
error=1; /* purecov: inspected */
|
||||||
build_table_path(path, sizeof(path), db, table_name, "");
|
*fn_ext(path)= 0; // Remove reg_ext
|
||||||
return ha_delete_table(base,path) || error;
|
return ha_delete_table(base,path) || error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1339,7 +1339,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
|||||||
/* Check if table exists */
|
/* Check if table exists */
|
||||||
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
|
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
|
||||||
{
|
{
|
||||||
char tmp_table_name[NAME_LEN+1];
|
char tmp_table_name[tmp_file_prefix_length+22+22+22+3];
|
||||||
my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x",
|
my_snprintf(tmp_table_name, sizeof(tmp_table_name), "%s%lx_%lx_%x",
|
||||||
tmp_file_prefix, current_pid, thd->thread_id,
|
tmp_file_prefix, current_pid, thd->thread_id,
|
||||||
thd->tmp_table++);
|
thd->tmp_table++);
|
||||||
@ -2622,7 +2622,7 @@ int mysql_create_indexes(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
|
|||||||
build_table_path(path, sizeof(path), table_list->db,
|
build_table_path(path, sizeof(path), table_list->db,
|
||||||
(lower_case_table_names == 2) ?
|
(lower_case_table_names == 2) ?
|
||||||
table_list->alias : table_list->real_name,
|
table_list->alias : table_list->real_name,
|
||||||
reg_ext) != 0 ||
|
reg_ext) == 0 ||
|
||||||
mysql_create_frm(thd, path, &create_info,
|
mysql_create_frm(thd, path, &create_info,
|
||||||
fields, key_count, key_info_buffer, table->file))
|
fields, key_count, key_info_buffer, table->file))
|
||||||
/* don't need to free((gptr) key_info_buffer);*/
|
/* don't need to free((gptr) key_info_buffer);*/
|
||||||
@ -2723,7 +2723,7 @@ int mysql_drop_indexes(THD *thd, TABLE_LIST *table_list,
|
|||||||
build_table_path(path, sizeof(path), table_list->db,
|
build_table_path(path, sizeof(path), table_list->db,
|
||||||
(lower_case_table_names == 2) ?
|
(lower_case_table_names == 2) ?
|
||||||
table_list->alias : table_list->real_name,
|
table_list->alias : table_list->real_name,
|
||||||
reg_ext) != 0 ||
|
reg_ext) == 0 ||
|
||||||
mysql_create_frm(thd, path, &create_info,
|
mysql_create_frm(thd, path, &create_info,
|
||||||
fields, key_count, key_info_buffer, table->file))
|
fields, key_count, key_info_buffer, table->file))
|
||||||
/*don't need to free((gptr) key_numbers);*/
|
/*don't need to free((gptr) key_numbers);*/
|
||||||
|
@ -28,13 +28,10 @@
|
|||||||
** dynamic functions, so this shouldn't be a real problem.
|
** dynamic functions, so this shouldn't be a real problem.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <my_global.h>
|
|
||||||
|
|
||||||
#ifdef USE_PRAGMA_IMPLEMENTATION
|
|
||||||
#pragma implementation // gcc: implement sql_udf.h
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
||||||
|
#pragma implementation // gcc: Class implementation
|
||||||
|
#endif
|
||||||
#include <my_pthread.h>
|
#include <my_pthread.h>
|
||||||
|
|
||||||
#ifdef HAVE_DLOPEN
|
#ifdef HAVE_DLOPEN
|
||||||
|
@ -4064,7 +4064,6 @@ replace:
|
|||||||
}
|
}
|
||||||
insert_field_spec
|
insert_field_spec
|
||||||
{}
|
{}
|
||||||
{}
|
|
||||||
;
|
;
|
||||||
|
|
||||||
insert_lock_option:
|
insert_lock_option:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user