Commit fd548d58 authored by Tatiana A. Nurnberg's avatar Tatiana A. Nurnberg

auto-merged

parents 98eccd94 25441304
......@@ -176,7 +176,7 @@ check_cpu () {
fi
cc_ver=`$cc --version | sed 1q`
cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
set -- `echo $cc_verno | tr '.' ' '`
cc_major=$1
cc_minor=$2
......
......@@ -2372,28 +2372,3 @@ a MIN(b) MAX(b) AVG(b)
2 1 3 2.0000
1 1 3 2.0000
DROP TABLE t1;
create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM;
insert into t1 (a,b) values (0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),(0,7),
(0,8),(0,9),(0,10),(0,11);
insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a;
select * from t1;
a b
0 0
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 10
0 11
0 12
explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,index PRIMARY 4 NULL 5 Using where; Using index for group-by; Using temporary
Warnings:
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a`
drop table t1;
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
FLUSH TABLES;
# replacing t1.MYI with a corrupt + unclosed one created by doing:
# 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI
SELECT * FROM t1_will_crash;
a
1
2
3
4
5
6
7
8
9
10
11
Warnings:
Error 145 Table './test/t1_will_crash' is marked as crashed and should be repaired
Error 1194 Table 't1_will_crash' is marked as crashed and should be repaired
Error 1034 1 client is using or hasn't closed the table properly
Error 1034 Size of indexfile is: 1024 Should be: 2048
Error 1034 Size of datafile is: 77 Should be: 7
Error 1034 Number of rows changed from 1 to 11
DROP TABLE t1_will_crash;
CREATE TABLE t1_will_crash (a INT, KEY (a))
ENGINE=MyISAM
PARTITION BY HASH(a)
PARTITIONS 3;
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
FLUSH TABLES;
# replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing:
# 'create table t1 (a int key(a)) partition by hash (a) partitions 3'
# head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI
SELECT * FROM t1_will_crash;
a
1
2
3
4
5
6
7
8
9
10
11
Warnings:
Error 145 Table './test/t1_will_crash#P#p1' is marked as crashed and should be repaired
Error 1194 Table 't1_will_crash' is marked as crashed and should be repaired
Error 1034 1 client is using or hasn't closed the table properly
Error 1034 Size of indexfile is: 1024 Should be: 2048
Error 1034 Size of datafile is: 28 Should be: 7
Error 1034 Number of rows changed from 1 to 4
DROP TABLE t1_will_crash;
# test the auto-recover (--myisam-recover) of partitioned myisam tables
--source include/have_partition.inc
--disable_warnings
--disable_query_log
drop table if exists t1_will_crash;
--enable_query_log
--enable_warnings
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
FLUSH TABLES;
--echo # replacing t1.MYI with a corrupt + unclosed one created by doing:
--echo # 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash.MYI
--copy_file std_data/corrupt_t1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash.MYI
SELECT * FROM t1_will_crash;
DROP TABLE t1_will_crash;
CREATE TABLE t1_will_crash (a INT, KEY (a))
ENGINE=MyISAM
PARTITION BY HASH(a)
PARTITIONS 3;
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
FLUSH TABLES;
--echo # replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing:
--echo # 'create table t1 (a int key(a)) partition by hash (a) partitions 3'
--echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI
--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI
SELECT * FROM t1_will_crash;
DROP TABLE t1_will_crash;
......@@ -1795,6 +1795,7 @@ lock tables t1 read;
connect (con1,localhost,root,,);
--connection con1
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
--replace_result $MYSQLTEST_VARDIR . master-data/ '' 13 2
# EE_FILENOTFOUND 29
--error 29
select * from t1;
......
......@@ -942,15 +942,3 @@ SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
DROP TABLE t1;
#
# Bug#38195: Incorrect handling of aggregate functions when loose index scan is
# used causes server crash.
#
create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM;
insert into t1 (a,b) values (0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),(0,7),
(0,8),(0,9),(0,10),(0,11);
insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a;
select * from t1;
explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;
drop table t1;
......@@ -354,7 +354,7 @@ size_t unpack_dirname(char * to, const char *from)
length-= (size_t) (suffix-buff)-1;
if (length+(h_length= strlen(tilde_expansion)) <= FN_REFLEN)
{
if (tilde_expansion[h_length-1] == FN_LIBCHAR)
if ((h_length > 0) && (tilde_expansion[h_length-1] == FN_LIBCHAR))
h_length--;
if (buff+h_length < suffix)
bmove(buff+h_length,suffix,length);
......
......@@ -53,6 +53,9 @@ make
# so the file will be linked
(cd sql; make sql_yacc.cc)
# we need initilizing SQL files.
(cd netware; make test_db.sql init_db.sql)
# copying required linux tools
cp extra/comp_err extra/comp_err.linux
cp libmysql/conf_to_src libmysql/conf_to_src.linux
......
......@@ -91,8 +91,8 @@ done
echo "starting build..."
# check for bk and repo_dir
bk help > /dev/null
repo_dir=`bk root $repo_dir`
bzr help > /dev/null
repo_dir=`bzr root $repo_dir`
cd $repo_dir
doc_dir="$repo_dir/../mysqldoc"
......@@ -100,7 +100,7 @@ doc_dir="$repo_dir/../mysqldoc"
temp_dir="$build_dir/mysql-$$.tmp"
# export the bk tree
command="bk export";
command="bzr export";
if test $revision; then command="$command -r$revision"; fi
command="$command $temp_dir"
echo "exporting $repo_dir..."
......@@ -183,6 +183,8 @@ awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {pri
# build linux tools
echo "compiling linux tools..."
./netware/BUILD/compile-linux-tools
test -f ./netware/init_db.sql # this must exist
test -f ./netware/test_db.sql # this must exist
# compile
if test $build
......
......@@ -107,8 +107,7 @@ init_db.sql: $(top_srcdir)/scripts/mysql_system_tables.sql \
@echo "CREATE DATABASE mysql;" > $@;
@echo "CREATE DATABASE test;" >> $@;
@echo "use mysql;" >> $@;
@cat $(top_srcdir)/scripts/mysql_system_tables.sql \
$(top_srcdir)/scripts/mysql_system_tables_fix.sql >> $@;
@cat $(top_srcdir)/scripts/mysql_system_tables.sql >> $@;
# Build test_db.sql from init_db.sql plus
# some test data
......
......@@ -327,6 +327,7 @@ int mysql_install_db(int argc, char *argv[])
arg_list_t al;
int i, j, err;
char skip;
struct stat info;
// private options
static char *private_options[] =
......@@ -362,6 +363,24 @@ int mysql_install_db(int argc, char *argv[])
add_arg(&al, "--skip-grant-tables");
add_arg(&al, "--skip-innodb");
if ((err = stat(sql_file, &info)) != 0)
{
printf("ERROR - %s:\n", strerror(errno));
printf("\t%s\n\n", sql_file);
// free args
free_args(&al);
exit(-1);
}
if ((err = stat(sql_file, &info)) != 0)
{
printf("ERROR - %s:\n", strerror(errno));
printf("\t%s\n\n", sql_file);
// free args
free_args(&al);
exit(-1);
}
// spawn mysqld
err = spawn(mysqld, &al, TRUE, sql_file, out_log, err_log);
......@@ -394,9 +413,9 @@ int main(int argc, char **argv)
// install the database
if (mysql_install_db(argc, argv))
{
printf("ERROR - The database creation failed!\n");
printf("ERROR - Failed to create the database!\n");
printf(" %s\n", strerror(errno));
printf("See the following log for more infomration:\n");
printf("See the following log for more information:\n");
printf("\t%s\n\n", err_log);
exit(-1);
}
......
......@@ -2494,6 +2494,8 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
err_handler:
while (file-- != m_file)
(*file)->close();
if (!is_clone)
bitmap_free(&(m_part_info->used_partitions));
DBUG_RETURN(error);
}
......
......@@ -1794,8 +1794,7 @@ JOIN::exec()
if (!items1)
{
items1= items0 + all_fields.elements;
if (sort_and_group || curr_tmp_table->group ||
tmp_table_param.precomputed_group_by)
if (sort_and_group || curr_tmp_table->group)
{
if (change_to_use_tmp_fields(thd, items1,
tmp_fields_list1, tmp_all_fields1,
......@@ -9629,8 +9628,6 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
MI_COLUMNDEF *recinfo;
uint total_uneven_bit_length= 0;
bool force_copy_fields= param->force_copy_fields;
/* Treat sum functions as normal ones when loose index scan is used. */
save_sum_fields|= param->precomputed_group_by;
DBUG_ENTER("create_tmp_table");
DBUG_PRINT("enter",
("distinct: %d save_sum_fields: %d rows_limit: %lu group: %d",
......
......@@ -6644,17 +6644,15 @@ int initialize_schema_table(st_plugin_int *plugin)
{
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
goto err;
plugin->data= NULL;
my_free(schema_table, MYF(0));
DBUG_RETURN(1);
}
/* Make sure the plugin name is not set inside the init() function. */
schema_table->table_name= plugin->name.str;
}
DBUG_RETURN(0);
err:
my_free(schema_table, MYF(0));
DBUG_RETURN(1);
}
int finalize_schema_table(st_plugin_int *plugin)
......
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