Skip to content

Commit 31d6e9c

Browse files
committed
Fix of error messages with big help of serg
1 parent fa57e11 commit 31d6e9c

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

mysql-test/main/gis2.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ SET timestamp=default;
3333
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1))));
3434
set timestamp=10;
3535
alter table t1 add column i int;
36-
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`(temporary)`.`p` at row 1
36+
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`t1`.`p` at row 1
3737
drop table t1;
3838
SET timestamp=default;

mysql-test/suite/innodb_gis/r/alter_spatial_index.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ SET timestamp=default;
795795
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
796796
set timestamp=10;
797797
alter table t1 add column i int;
798-
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`(temporary)`.`p` at row 1
798+
ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column `test`.`t1`.`p` at row 1
799799
drop table t1;
800800
SET timestamp=default;
801801
CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;

sql/sql_table.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9695,7 +9695,7 @@ do_continue:;
96959695
thd->create_and_open_tmp_table(new_db_type, &frm,
96969696
alter_ctx.get_tmp_path(),
96979697
alter_ctx.new_db.str,
9698-
alter_ctx.tmp_name.str,
9698+
alter_ctx.new_name.str,
96999699
false, true)))
97009700
goto err_new_table_cleanup;
97019701

storage/innobase/handler/handler0alter.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5034,18 +5034,15 @@ prepare_inplace_alter_table_dict(
50345034
goto err_exit;
50355035
}
50365036

5037-
size_tdblen = ctx->old_table->name.dblen() + 1;
5038-
size_ttablen = altered_table->s->table_name.length;
5037+
size_tprefixlen= strlen(mysql_data_home) + 1;
5038+
size_ttablen = altered_table->s->path.length - prefixlen;
50395039
const char* part = ctx->old_table->name.part();
50405040
size_tpartlen = part ? strlen(part) : 0;
50415041
char* new_table_name = static_cast<char*>(
5042-
mem_heap_alloc(ctx->heap,
5043-
dblen + tablen + partlen + 1));
5044-
memcpy(new_table_name, ctx->old_table->name.m_name, dblen);
5045-
memcpy(new_table_name + dblen,
5046-
altered_table->s->table_name.str, tablen);
5047-
memcpy(new_table_name + dblen + tablen,
5048-
part ? part : "", partlen + 1);
5042+
mem_heap_alloc(ctx->heap, tablen + partlen + 1));
5043+
memcpy(new_table_name,
5044+
altered_table->s->path.str + prefixlen, tablen);
5045+
memcpy(new_table_name + tablen, part ? part : "", partlen + 1);
50495046
ulint n_cols = 0;
50505047
ulint n_v_cols = 0;
50515048
dtuple_t* defaults;

0 commit comments

Comments
 (0)