Commit 31d6e9c3 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Fix of error messages with big help of serg

parent fa57e118
...@@ -33,6 +33,6 @@ SET timestamp=default; ...@@ -33,6 +33,6 @@ SET timestamp=default;
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))); create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1))));
set timestamp=10; set timestamp=10;
alter table t1 add column i int; alter table t1 add column i int;
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`(temporary)`.`p` at row 1 ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`t1`.`p` at row 1
drop table t1; drop table t1;
SET timestamp=default; SET timestamp=default;
...@@ -795,7 +795,7 @@ SET timestamp=default; ...@@ -795,7 +795,7 @@ SET timestamp=default;
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb; create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10; set timestamp=10;
alter table t1 add column i int; alter table t1 add column i int;
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`(temporary)`.`p` at row 1 ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`t1`.`p` at row 1
drop table t1; drop table t1;
SET timestamp=default; SET timestamp=default;
CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB; CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
......
...@@ -9695,7 +9695,7 @@ do_continue:; ...@@ -9695,7 +9695,7 @@ do_continue:;
thd->create_and_open_tmp_table(new_db_type, &frm, thd->create_and_open_tmp_table(new_db_type, &frm,
alter_ctx.get_tmp_path(), alter_ctx.get_tmp_path(),
alter_ctx.new_db.str, alter_ctx.new_db.str,
alter_ctx.tmp_name.str, alter_ctx.new_name.str,
false, true))) false, true)))
goto err_new_table_cleanup; goto err_new_table_cleanup;
......
...@@ -5034,18 +5034,15 @@ prepare_inplace_alter_table_dict( ...@@ -5034,18 +5034,15 @@ prepare_inplace_alter_table_dict(
goto err_exit; goto err_exit;
} }
size_t dblen = ctx->old_table->name.dblen() + 1; size_t prefixlen= strlen(mysql_data_home) + 1;
size_t tablen = altered_table->s->table_name.length; size_t tablen = altered_table->s->path.length - prefixlen;
const char* part = ctx->old_table->name.part(); const char* part = ctx->old_table->name.part();
size_t partlen = part ? strlen(part) : 0; size_t partlen = part ? strlen(part) : 0;
char* new_table_name = static_cast<char*>( char* new_table_name = static_cast<char*>(
mem_heap_alloc(ctx->heap, mem_heap_alloc(ctx->heap, tablen + partlen + 1));
dblen + tablen + partlen + 1)); memcpy(new_table_name,
memcpy(new_table_name, ctx->old_table->name.m_name, dblen); altered_table->s->path.str + prefixlen, tablen);
memcpy(new_table_name + dblen, memcpy(new_table_name + tablen, part ? part : "", partlen + 1);
altered_table->s->table_name.str, tablen);
memcpy(new_table_name + dblen + tablen,
part ? part : "", partlen + 1);
ulint n_cols = 0; ulint n_cols = 0;
ulint n_v_cols = 0; ulint n_v_cols = 0;
dtuple_t* defaults; dtuple_t* defaults;
......
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