Commit 1c5ca806 authored by unknown's avatar unknown

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


mysql-test/include/varchar.inc:
  Move handler dependent tests to the specific handler (myisam, bdb, innodb)
mysql-test/r/innodb.result:
  Added varchar tests
mysql-test/r/myisam.result:
  Update results
mysql-test/t/bdb.test:
  Move handler dependent tests to the specific handler (myisam, bdb, innodb)
mysql-test/t/innodb.test:
  Enabled VARCHAR testing
mysql-test/t/myisam.test:
  Move handler dependent tests to the specific handler (myisam, bdb, innodb)
sql/sql_parse.cc:
  Indentation fixes
sql/sql_table.cc:
  Fixed bug introduced when doing cleanup
parent 06f59b28
......@@ -226,16 +226,3 @@ create table t1 (v varchar(65530), key(v(10)));
insert into t1 values(repeat('a',65530));
select length(v) from t1 where v=repeat('a',65530);
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` (
`v` mediumtext character set utf8
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set storage_engine=MyISAM;
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
set storage_engine=MyISAM;
create table t1 (a int) engine=myisam;
drop table if exists t1;
Warnings:
......
......@@ -954,4 +954,19 @@ drop table t1;
let $default=`select @@storage_engine`;
set storage_engine=bdb;
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;
......@@ -1285,10 +1285,24 @@ show variables like "innodb_thread_sleep_delay";
# Test varchar
#
#let $default=`select @@storage_engine`;
#set storage_engine=INNODB;
#source include/varchar.inc;
#eval set storage_engine=$default;
let $default=`select @@storage_engine`;
set storage_engine=INNODB;
source include/varchar.inc;
#
# 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
create table t1 (v varchar(16384)) engine=innodb;
......@@ -1297,3 +1311,4 @@ drop table t1;
# The following should be moved to type_bit.test when innodb will support it
--error 1178
create table t1 (a bit, key(a)) engine=innodb;
......@@ -560,12 +560,26 @@ drop table t1,t2;
let $default=`select @@storage_engine`;
set storage_engine=MyISAM;
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
--error 1118
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
......
......@@ -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 *ptr;
NESTED_JOIN *nested_join;
DBUG_ENTER("end_nested_join");
DBUG_ASSERT(embedding);
ptr= embedding;
join_list= ptr->join_list;
embedding= ptr->embedding;
NESTED_JOIN *nested_join= ptr->nested_join;
nested_join= ptr->nested_join;
if (nested_join->join_list.elements == 1)
{
TABLE_LIST *embedded= nested_join->join_list.head();
......@@ -5860,11 +5862,10 @@ TABLE_LIST *st_select_lex::end_nested_join(THD *thd)
join_list->push_front(embedded);
ptr= embedded;
}
else
if (nested_join->join_list.elements == 0)
else if (nested_join->join_list.elements == 0)
{
join_list->pop();
DBUG_RETURN(0);
ptr= 0; // return value
}
DBUG_RETURN(ptr);
}
......
......@@ -476,7 +476,7 @@ int prepare_create_field(create_field *sql_field,
sql_field->pack_flag|=FIELDFLAG_BINARY;
sql_field->length=8; // Unireg field length
sql_field->unireg_check=Field::BLOB_FIELD;
blob_columns++;
(*blob_columns)++;
break;
case FIELD_TYPE_GEOMETRY:
#ifdef HAVE_SPATIAL
......@@ -493,7 +493,7 @@ int prepare_create_field(create_field *sql_field,
sql_field->pack_flag|=FIELDFLAG_BINARY;
sql_field->length=8; // Unireg field length
sql_field->unireg_check=Field::BLOB_FIELD;
blob_columns++;
(*blob_columns)++;
break;
#else
my_printf_error(ER_FEATURE_DISABLED,ER(ER_FEATURE_DISABLED), MYF(0),
......@@ -570,18 +570,18 @@ int prepare_create_field(create_field *sql_field,
/* We should replace old TIMESTAMP fields with their newer analogs */
if (sql_field->unireg_check == Field::TIMESTAMP_OLD_FIELD)
{
if (!timestamps)
if (!*timestamps)
{
sql_field->unireg_check= Field::TIMESTAMP_DNUN_FIELD;
timestamps_with_niladic++;
(*timestamps_with_niladic)++;
}
else
sql_field->unireg_check= Field::NONE;
}
else if (sql_field->unireg_check != Field::NONE)
timestamps_with_niladic++;
(*timestamps_with_niladic)++;
timestamps++;
(*timestamps)++;
/* fall-through */
default:
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