[Commits] 31d6e9c3c83: Fix of error messages with big help of serg
revision-id: 31d6e9c3c83c5248789df14f13e6f14599170f9c (mariadb-10.3.12-49-g31d6e9c3c83) parent(s): fa57e118445735fce44565b7dea48ec8bf86bbe4 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2019-02-12 10:48:19 +0100 message: Fix of error messages with big help of serg --- mysql-test/main/gis2.result | 2 +- mysql-test/suite/innodb_gis/r/alter_spatial_index.result | 2 +- sql/sql_table.cc | 2 +- storage/innobase/handler/handler0alter.cc | 15 ++++++--------- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/mysql-test/main/gis2.result b/mysql-test/main/gis2.result index cb919ecdeb1..6eb1c54e8d4 100644 --- a/mysql-test/main/gis2.result +++ b/mysql-test/main/gis2.result @@ -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)))); set timestamp=10; 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; SET timestamp=default; diff --git a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result index d94e67d0765..703af3c40de 100644 --- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result +++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result @@ -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; set timestamp=10; 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; SET timestamp=default; CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c696ceb001e..7f2003b765b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -9695,7 +9695,7 @@ do_continue:; thd->create_and_open_tmp_table(new_db_type, &frm, alter_ctx.get_tmp_path(), alter_ctx.new_db.str, - alter_ctx.tmp_name.str, + alter_ctx.new_name.str, false, true))) goto err_new_table_cleanup; diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 02a6b2dd865..41607ec589e 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -5034,18 +5034,15 @@ prepare_inplace_alter_table_dict( goto err_exit; } - size_t dblen = ctx->old_table->name.dblen() + 1; - size_t tablen = altered_table->s->table_name.length; + size_t prefixlen= strlen(mysql_data_home) + 1; + size_t tablen = altered_table->s->path.length - prefixlen; const char* part = ctx->old_table->name.part(); size_t partlen = part ? strlen(part) : 0; char* new_table_name = static_cast<char*>( - mem_heap_alloc(ctx->heap, - dblen + tablen + partlen + 1)); - memcpy(new_table_name, ctx->old_table->name.m_name, dblen); - memcpy(new_table_name + dblen, - altered_table->s->table_name.str, tablen); - memcpy(new_table_name + dblen + tablen, - part ? part : "", partlen + 1); + mem_heap_alloc(ctx->heap, tablen + partlen + 1)); + memcpy(new_table_name, + altered_table->s->path.str + prefixlen, tablen); + memcpy(new_table_name + tablen, part ? part : "", partlen + 1); ulint n_cols = 0; ulint n_v_cols = 0; dtuple_t* defaults;
participants (1)
-
Oleksandr Byelkin