Commit 91cb248a authored by unknown's avatar unknown

Merge hholzgraefe@bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/hartmut/projects/mysql/dev/5.0

parents 651134cf a5dd3d5d
......@@ -10,7 +10,7 @@ prefix_configs="--prefix=/usr/local/mysql"
just_print=
just_configure=
full_debug=
if test -n $MYSQL_BUILD_PREFIX
if test ! -z $MYSQL_BUILD_PREFIX
then
prefix_configs="--prefix=$MYSQL_BUILD_PREFIX"
fi
......
This diff is collapsed.
......@@ -2137,7 +2137,8 @@ sub mysqld_start ($$$$) {
{
if ( $pid= mtr_spawn($exe, $args, "",
$master->[$idx]->{'path_myerr'},
$master->[$idx]->{'path_myerr'}, "") )
$master->[$idx]->{'path_myerr'}, "",
{ append_log_file => 1 }) )
{
return sleep_until_file_created($master->[$idx]->{'path_mypid'},
$master->[$idx]->{'start_timeout'}, $pid);
......@@ -2148,7 +2149,8 @@ sub mysqld_start ($$$$) {
{
if ( $pid= mtr_spawn($exe, $args, "",
$slave->[$idx]->{'path_myerr'},
$slave->[$idx]->{'path_myerr'}, "") )
$slave->[$idx]->{'path_myerr'}, "",
{ append_log_file => 1 }) )
{
return sleep_until_file_created($slave->[$idx]->{'path_mypid'},
$master->[$idx]->{'start_timeout'}, $pid);
......
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
drop table if exists t3;
Warnings:
Note 1051 Unknown table 't3'
drop table if exists t4;
Warnings:
Note 1051 Unknown table 't4'
drop table if exists t5;
Warnings:
Note 1051 Unknown table 't5'
drop table if exists t6;
Warnings:
Note 1051 Unknown table 't6'
create table t1 (id int(8), name varchar(32));
create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM";
create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY";
create table t4 (id int(8), name varchar(32)) ENGINE="HEAP";
create table t5 (id int(8), name varchar(32)) ENGINE="ARCHIVE";
create table t6 (id int(8), name varchar(32)) ENGINE="InnoDB";
insert into t1 values (1, 'first value');
insert into t1 values (2, 'first value');
insert into t1 values (3, 'first value');
insert into t1 values (4, 'first value');
insert into t1 values (5, 'first value');
insert into t2 values (1, 'first value');
insert into t2 values (2, 'first value');
insert into t2 values (3, 'first value');
insert into t2 values (4, 'first value');
insert into t2 values (5, 'first value');
insert into t3 values (1, 'first value');
insert into t3 values (2, 'first value');
insert into t3 values (3, 'first value');
insert into t3 values (4, 'first value');
insert into t3 values (5, 'first value');
insert into t4 values (1, 'first value');
insert into t4 values (2, 'first value');
insert into t4 values (3, 'first value');
insert into t4 values (4, 'first value');
insert into t4 values (5, 'first value');
insert into t5 values (1, 'first value');
insert into t5 values (2, 'first value');
insert into t5 values (3, 'first value');
insert into t5 values (4, 'first value');
insert into t5 values (5, 'first value');
insert into t6 values (1, 'first value');
insert into t6 values (2, 'first value');
insert into t6 values (3, 'first value');
insert into t6 values (4, 'first value');
insert into t6 values (5, 'first value');
select * from t1;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t2;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t3;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t4;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t5;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
select * from t6;
id name
1 first value
2 first value
3 first value
4 first value
5 first value
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `test`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
CREATE TABLE `t3` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
CREATE TABLE `t4` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
CREATE TABLE `t5` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
CREATE TABLE `t6` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t6` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `test`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`;
CREATE TABLE `t3` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`;
CREATE TABLE `t4` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`;
CREATE TABLE `t5` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`;
CREATE TABLE `t6` (
`id` int(8) default NULL,
`name` varchar(32) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t6` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1;
drop table t2;
drop table t3;
drop table t4;
drop table t5;
drop table t6;
......@@ -614,9 +614,7 @@ CREATE TABLE `t1` (
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
LOCK TABLES `t1` WRITE;
INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
UNLOCK TABLES;
INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
......
......@@ -2262,3 +2262,29 @@ WEEKDAY(date)
1
DROP TABLE t1;
DROP VIEW v1, v2, v3;
CREATE TABLE t1 ( a int, b int );
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
CREATE VIEW v1 AS SELECT a,b FROM t1;
SELECT t1.a FROM t1 GROUP BY t1.a HAVING a > 1;
a
2
3
SELECT v1.a FROM v1 GROUP BY v1.a HAVING a > 1;
a
2
3
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 ( a int, b int );
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
CREATE VIEW v1 AS SELECT a,b FROM t1;
SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > 1;
a
2
3
SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1;
a
2
3
DROP VIEW v1;
DROP TABLE t1;
# Embedded server doesn't support external clients
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_archive.inc
--disable-warnings
drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
drop table if exists t5;
drop table if exists t6;
--enable-warnings
create table t1 (id int(8), name varchar(32));
create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM";
create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY";
create table t4 (id int(8), name varchar(32)) ENGINE="HEAP";
create table t5 (id int(8), name varchar(32)) ENGINE="ARCHIVE";
create table t6 (id int(8), name varchar(32)) ENGINE="InnoDB";
insert into t1 values (1, 'first value');
insert into t1 values (2, 'first value');
insert into t1 values (3, 'first value');
insert into t1 values (4, 'first value');
insert into t1 values (5, 'first value');
insert into t2 values (1, 'first value');
insert into t2 values (2, 'first value');
insert into t2 values (3, 'first value');
insert into t2 values (4, 'first value');
insert into t2 values (5, 'first value');
insert into t3 values (1, 'first value');
insert into t3 values (2, 'first value');
insert into t3 values (3, 'first value');
insert into t3 values (4, 'first value');
insert into t3 values (5, 'first value');
insert into t4 values (1, 'first value');
insert into t4 values (2, 'first value');
insert into t4 values (3, 'first value');
insert into t4 values (4, 'first value');
insert into t4 values (5, 'first value');
insert into t5 values (1, 'first value');
insert into t5 values (2, 'first value');
insert into t5 values (3, 'first value');
insert into t5 values (4, 'first value');
insert into t5 values (5, 'first value');
insert into t6 values (1, 'first value');
insert into t6 values (2, 'first value');
insert into t6 values (3, 'first value');
insert into t6 values (4, 'first value');
insert into t6 values (5, 'first value');
select * from t1;
select * from t2;
select * from t3;
select * from t4;
select * from t5;
select * from t6;
--exec $MYSQL_DUMP --skip-comments --delayed-insert --insert-ignore --databases test
--exec $MYSQL_DUMP --skip-comments --delayed-insert --databases test
drop table t1;
drop table t2;
drop table t3;
drop table t4;
drop table t5;
drop table t6;
......@@ -2139,3 +2139,29 @@ SELECT * FROM v3;
DROP TABLE t1;
DROP VIEW v1, v2, v3;
#
# Bug #13411: crash when using non-qualified view column in HAVING clause
#
CREATE TABLE t1 ( a int, b int );
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
CREATE VIEW v1 AS SELECT a,b FROM t1;
SELECT t1.a FROM t1 GROUP BY t1.a HAVING a > 1;
SELECT v1.a FROM v1 GROUP BY v1.a HAVING a > 1;
DROP VIEW v1;
DROP TABLE t1;
#
# Bug #13410: failed name resolution for qualified view column in HAVING
#
CREATE TABLE t1 ( a int, b int );
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
CREATE VIEW v1 AS SELECT a,b FROM t1;
SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > 1;
SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1;
DROP VIEW v1;
DROP TABLE t1;
......@@ -1687,7 +1687,7 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const
return 0;
Item_field *item_field= (Item_field*) item;
if (item_field->field)
if (item_field->field && field)
return item_field->field == field;
/*
We may come here when we are trying to find a function in a GROUP BY
......@@ -1701,10 +1701,10 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const
*/
return (!my_strcasecmp(system_charset_info, item_field->name,
field_name) &&
(!item_field->table_name ||
(!item_field->table_name || !table_name ||
(!my_strcasecmp(table_alias_charset, item_field->table_name,
table_name) &&
(!item_field->db_name ||
(!item_field->db_name || !db_name ||
(item_field->db_name && !strcmp(item_field->db_name,
db_name))))));
}
......@@ -2983,7 +2983,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
for (ORDER *cur_group= group_list ; cur_group ; cur_group= cur_group->next)
{
if ((*(cur_group->item))->type() == Item::FIELD_ITEM)
if ((*(cur_group->item))->real_item()->type() == Item::FIELD_ITEM)
{
cur_field= (Item_field*) *cur_group->item;
cur_match_degree= 0;
......
......@@ -3459,7 +3459,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
}
}
else if (!table_name && (item->eq(find,0) ||
else if (!table_name && (find->eq(item,0) ||
find->name && item->name &&
!my_strcasecmp(system_charset_info,
item->name,find->name)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment