Commit dd0f6224 authored by unknown's avatar unknown

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

into mysql.com:/usr/local/home/marty/MySQL/mysql-5.0-ndb


BitKeeper/etc/logging_ok:
  auto-union
BitKeeper/triggers/post-commit:
  Auto merged
sql/item.cc:
  Auto merged
sql/log.cc:
  Auto merged
parents 9387349e 0e9b1c1d
......@@ -811,7 +811,7 @@ sub find
sub rm_all
{
my(@rm_files)=@_;
my($dir,$current_dir,@files,@dirs);
my($dir,$current_dir,@files,@dirs,$removed);
$current_dir = `pwd`; chomp($current_dir);
foreach $dir (@rm_files)
......@@ -835,7 +835,9 @@ sub rm_all
}
if ($#files >= 0)
{
system("rm -f " . join(" ",@files)) && abort("Can't remove files from $dir");
$removed= unlink @files;
print "rm_all : removed $removed files in $current_dir/$dir\n" if ($opt_debug);
abort("Can't remove all $#files+1 from $current_dir/$dir, just $removed") if $removed != $#files+1;
}
foreach $dir (@dirs)
{
......
......@@ -637,7 +637,7 @@ extern int pthread_dummy(int);
MySQL can survive with 32K, but some glibc libraries require > 128K stack
To resolve hostnames
*/
#define DEFAULT_THREAD_STACK (192*1024L)
#define DEFAULT_THREAD_STACK (256*1024L)
#else
#define DEFAULT_THREAD_STACK (192*1024)
#endif
......
......@@ -2388,3 +2388,16 @@ WART 0100 1
WART 0200 1
WART 0300 3
DROP TABLE t1;
CREATE TABLE t1 ( a BLOB, INDEX (a(20)) );
CREATE TABLE t2 ( a BLOB, INDEX (a(20)) );
INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t2 ref a a 23 test.t1.a 2
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t2 ref a a 23 test.t1.a 2
DROP TABLE t1, t2;
......@@ -1970,3 +1970,18 @@ SELECT K2C4, K4N4, F2I4 FROM t1
WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200');
DROP TABLE t1;
#
# Test case for bug 7520: a wrong cost of the index for a BLOB field
#
CREATE TABLE t1 ( a BLOB, INDEX (a(20)) );
CREATE TABLE t2 ( a BLOB, INDEX (a(20)) );
INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
DROP TABLE t1, t2;
......@@ -1714,6 +1714,26 @@ innobase_close_connection(
** InnoDB database tables
*****************************************************************************/
/********************************************************************
Get the record format from the data dictionary. */
enum row_type
ha_innobase::get_row_type() const
/*=============================*/
/* out: ROW_TYPE_REDUNDANT or ROW_TYPE_COMPACT */
{
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
if (prebuilt && prebuilt->table) {
if (prebuilt->table->comp) {
return(ROW_TYPE_COMPACT);
} else {
return(ROW_TYPE_REDUNDANT);
}
}
ut_ad(0);
return(ROW_TYPE_NOT_USED);
}
/********************************************************************
Gives the file extension of an InnoDB single-table tablespace. */
......
......@@ -96,6 +96,11 @@ class ha_innobase: public handler
{
}
~ha_innobase() {}
/*
Get the row type from the storage engine. If this method returns
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
*/
enum row_type get_row_type() const;
const char* table_type() const { return("InnoDB");}
const char *index_type(uint key_number) { return "BTREE"; }
......
......@@ -385,6 +385,12 @@ class handler :public Sql_alloc
virtual ha_rows estimate_rows_upper_bound()
{ return records+EXTRA_RECORDS; }
/*
Get the row type from the storage engine. If this method returns
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
*/
virtual enum row_type get_row_type() const { return ROW_TYPE_NOT_USED; }
virtual const char *index_type(uint key_number) { DBUG_ASSERT(0); return "";}
int ha_index_init(uint idx)
......
......@@ -2048,10 +2048,31 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
tmp_buff= file->table_type();
table->field[4]->store(tmp_buff, strlen(tmp_buff), cs);
table->field[5]->store((longlong) share->frm_version);
tmp_buff= ((share->db_options_in_use &
HA_OPTION_COMPRESS_RECORD) ? "Compressed" :
(share->db_options_in_use & HA_OPTION_PACK_RECORD) ?
"Dynamic" : "Fixed");
enum row_type row_type = file->get_row_type();
switch (row_type) {
case ROW_TYPE_NOT_USED:
case ROW_TYPE_DEFAULT:
tmp_buff= ((share->db_options_in_use &
HA_OPTION_COMPRESS_RECORD) ? "Compressed" :
(share->db_options_in_use & HA_OPTION_PACK_RECORD) ?
"Dynamic" : "Fixed");
break;
case ROW_TYPE_FIXED:
tmp_buff= "Fixed";
break;
case ROW_TYPE_DYNAMIC:
tmp_buff= "Dynamic";
break;
case ROW_TYPE_COMPRESSED:
tmp_buff= "Compressed";
break;
case ROW_TYPE_REDUNDANT:
tmp_buff= "Redundant";
break;
case ROW_TYPE_COMPACT:
tmp_buff= "Compact";
break;
}
table->field[6]->store(tmp_buff, strlen(tmp_buff), cs);
if (!tables->schema_table)
{
......
......@@ -661,6 +661,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
if (!(field->flags & BINARY_FLAG))
keyinfo->flags|= HA_END_SPACE_KEY;
}
set_if_bigger(share->max_key_length, keyinfo->key_length);
if (field->type() == MYSQL_TYPE_BIT)
key_part->key_part_flag|= HA_BIT_PART;
......
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