Commit aa6ab3b4 authored by monty@mysql.com's avatar monty@mysql.com

Move handler dependent tests to the specific handler (myisam, bdb, innodb)

Enabled VARCHAR testing for innodb

NOTE: innodb.test currently fails becasue of a bug in InnoDB. 
I have informed Heikki about this and expect him to fix this ASAP
parent f4294107
...@@ -226,16 +226,3 @@ create table t1 (v varchar(65530), key(v(10))); ...@@ -226,16 +226,3 @@ create table t1 (v varchar(65530), key(v(10)));
insert into t1 values(repeat('a',65530)); insert into t1 values(repeat('a',65530));
select length(v) from t1 where v=repeat('a',65530); select length(v) from t1 where v=repeat('a',65530);
drop table t1; drop table t1;
#
# Some errors/warnings on create
#
create table t1 (v varchar(65530), key(v));
drop table if exists t1;
create table t1 (v varchar(65536));
show create table t1;
drop table t1;
create table t1 (v varchar(65530) character set utf8);
show create table t1;
drop table t1;
This diff is collapsed.
...@@ -1171,9 +1171,9 @@ t1 CREATE TABLE `t1` ( ...@@ -1171,9 +1171,9 @@ t1 CREATE TABLE `t1` (
`v` mediumtext character set utf8 `v` mediumtext character set utf8
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
set storage_engine=MyISAM;
create table t1 (v varchar(65535)); create table t1 (v varchar(65535));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
set storage_engine=MyISAM;
create table t1 (a int) engine=myisam; create table t1 (a int) engine=myisam;
drop table if exists t1; drop table if exists t1;
Warnings: Warnings:
......
...@@ -954,4 +954,19 @@ drop table t1; ...@@ -954,4 +954,19 @@ drop table t1;
let $default=`select @@storage_engine`; let $default=`select @@storage_engine`;
set storage_engine=bdb; set storage_engine=bdb;
source include/varchar.inc; source include/varchar.inc;
#
# Some errors/warnings on create
#
create table t1 (v varchar(65530), key(v));
drop table if exists t1;
create table t1 (v varchar(65536));
show create table t1;
drop table t1;
create table t1 (v varchar(65530) character set utf8);
show create table t1;
drop table t1;
# End varchar test
eval set storage_engine=$default; eval set storage_engine=$default;
...@@ -1285,10 +1285,24 @@ show variables like "innodb_thread_sleep_delay"; ...@@ -1285,10 +1285,24 @@ show variables like "innodb_thread_sleep_delay";
# Test varchar # Test varchar
# #
#let $default=`select @@storage_engine`; let $default=`select @@storage_engine`;
#set storage_engine=INNODB; set storage_engine=INNODB;
#source include/varchar.inc; source include/varchar.inc;
#eval set storage_engine=$default;
#
# Some errors/warnings on create
#
--error 1005
create table t1 (v varchar(65530), key(v));
create table t1 (v varchar(65536));
show create table t1;
drop table t1;
create table t1 (v varchar(65530) character set utf8);
show create table t1;
drop table t1;
eval set storage_engine=$default;
# InnoDB specific varchar tests # InnoDB specific varchar tests
create table t1 (v varchar(16384)) engine=innodb; create table t1 (v varchar(16384)) engine=innodb;
...@@ -1297,3 +1311,4 @@ drop table t1; ...@@ -1297,3 +1311,4 @@ drop table t1;
# The following should be moved to type_bit.test when innodb will support it # The following should be moved to type_bit.test when innodb will support it
--error 1178 --error 1178
create table t1 (a bit, key(a)) engine=innodb; create table t1 (a bit, key(a)) engine=innodb;
...@@ -560,12 +560,26 @@ drop table t1,t2; ...@@ -560,12 +560,26 @@ drop table t1,t2;
let $default=`select @@storage_engine`; let $default=`select @@storage_engine`;
set storage_engine=MyISAM; set storage_engine=MyISAM;
source include/varchar.inc; source include/varchar.inc;
eval set storage_engine=$default;
#
# Some errors/warnings on create
#
create table t1 (v varchar(65530), key(v));
drop table if exists t1;
create table t1 (v varchar(65536));
show create table t1;
drop table t1;
create table t1 (v varchar(65530) character set utf8);
show create table t1;
drop table t1;
# MyISAM specific varchar tests # MyISAM specific varchar tests
--error 1118 --error 1118
create table t1 (v varchar(65535)); create table t1 (v varchar(65535));
eval set storage_engine=$default;
# #
# Test how DROP TABLE works if the index or data file doesn't exists # Test how DROP TABLE works if the index or data file doesn't exists
......
...@@ -5845,12 +5845,14 @@ bool st_select_lex::init_nested_join(THD *thd) ...@@ -5845,12 +5845,14 @@ bool st_select_lex::init_nested_join(THD *thd)
TABLE_LIST *st_select_lex::end_nested_join(THD *thd) TABLE_LIST *st_select_lex::end_nested_join(THD *thd)
{ {
TABLE_LIST *ptr; TABLE_LIST *ptr;
NESTED_JOIN *nested_join;
DBUG_ENTER("end_nested_join"); DBUG_ENTER("end_nested_join");
DBUG_ASSERT(embedding); DBUG_ASSERT(embedding);
ptr= embedding; ptr= embedding;
join_list= ptr->join_list; join_list= ptr->join_list;
embedding= ptr->embedding; embedding= ptr->embedding;
NESTED_JOIN *nested_join= ptr->nested_join; nested_join= ptr->nested_join;
if (nested_join->join_list.elements == 1) if (nested_join->join_list.elements == 1)
{ {
TABLE_LIST *embedded= nested_join->join_list.head(); TABLE_LIST *embedded= nested_join->join_list.head();
...@@ -5860,11 +5862,10 @@ TABLE_LIST *st_select_lex::end_nested_join(THD *thd) ...@@ -5860,11 +5862,10 @@ TABLE_LIST *st_select_lex::end_nested_join(THD *thd)
join_list->push_front(embedded); join_list->push_front(embedded);
ptr= embedded; ptr= embedded;
} }
else else if (nested_join->join_list.elements == 0)
if (nested_join->join_list.elements == 0)
{ {
join_list->pop(); join_list->pop();
DBUG_RETURN(0); ptr= 0; // return value
} }
DBUG_RETURN(ptr); DBUG_RETURN(ptr);
} }
......
...@@ -476,7 +476,7 @@ int prepare_create_field(create_field *sql_field, ...@@ -476,7 +476,7 @@ int prepare_create_field(create_field *sql_field,
sql_field->pack_flag|=FIELDFLAG_BINARY; sql_field->pack_flag|=FIELDFLAG_BINARY;
sql_field->length=8; // Unireg field length sql_field->length=8; // Unireg field length
sql_field->unireg_check=Field::BLOB_FIELD; sql_field->unireg_check=Field::BLOB_FIELD;
blob_columns++; (*blob_columns)++;
break; break;
case FIELD_TYPE_GEOMETRY: case FIELD_TYPE_GEOMETRY:
#ifdef HAVE_SPATIAL #ifdef HAVE_SPATIAL
...@@ -493,7 +493,7 @@ int prepare_create_field(create_field *sql_field, ...@@ -493,7 +493,7 @@ int prepare_create_field(create_field *sql_field,
sql_field->pack_flag|=FIELDFLAG_BINARY; sql_field->pack_flag|=FIELDFLAG_BINARY;
sql_field->length=8; // Unireg field length sql_field->length=8; // Unireg field length
sql_field->unireg_check=Field::BLOB_FIELD; sql_field->unireg_check=Field::BLOB_FIELD;
blob_columns++; (*blob_columns)++;
break; break;
#else #else
my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED), MYF(0), my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED), MYF(0),
...@@ -570,18 +570,18 @@ int prepare_create_field(create_field *sql_field, ...@@ -570,18 +570,18 @@ int prepare_create_field(create_field *sql_field,
/* We should replace old TIMESTAMP fields with their newer analogs */ /* We should replace old TIMESTAMP fields with their newer analogs */
if (sql_field->unireg_check == Field::TIMESTAMP_OLD_FIELD) if (sql_field->unireg_check == Field::TIMESTAMP_OLD_FIELD)
{ {
if (!timestamps) if (!*timestamps)
{ {
sql_field->unireg_check= Field::TIMESTAMP_DNUN_FIELD; sql_field->unireg_check= Field::TIMESTAMP_DNUN_FIELD;
timestamps_with_niladic++; (*timestamps_with_niladic)++;
} }
else else
sql_field->unireg_check= Field::NONE; sql_field->unireg_check= Field::NONE;
} }
else if (sql_field->unireg_check != Field::NONE) else if (sql_field->unireg_check != Field::NONE)
timestamps_with_niladic++; (*timestamps_with_niladic)++;
timestamps++; (*timestamps)++;
/* fall-through */ /* fall-through */
default: default:
sql_field->pack_flag=(FIELDFLAG_NUMBER | sql_field->pack_flag=(FIELDFLAG_NUMBER |
......
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