diff options
author | unknown <monty@mysql.com> | 2005-02-02 20:28:01 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-02-02 20:28:01 +0200 |
commit | 3d0f9d96d7236af2c4dc4bf844233e27497d59dc (patch) | |
tree | 816f40ac6d333fd1385b716ade92694569d78674 /sql | |
parent | 613c2f68e2c8de50be8caafac20256940990987e (diff) | |
download | mariadb-git-3d0f9d96d7236af2c4dc4bf844233e27497d59dc.tar.gz |
Fixed during review of new pulled code
extra/perror.c:
Use strmov() instead of strcpy()
Indentation fixes
sql/sql_table.cc:
Revert back part of the old code as the new code didn't use mysql_data_home, which would have caused problems in the embedded server
sql/sql_update.cc:
Ensure that used_index is always set (It has to be set because it's value is tested if order != 0)
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_table.cc | 9 | ||||
-rw-r--r-- | sql/sql_update.cc | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f3c107c2696..5f3875ba934 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2272,7 +2272,10 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, strxmov(src_path, (*tmp_table)->path, reg_ext, NullS); else { - fn_format( src_path, src_table, src_db, reg_ext, MYF(MY_UNPACK_FILENAME)); + strxmov(src_path, mysql_data_home, "/", src_db, "/", src_table, + reg_ext, NullS); + /* Resolve symlinks (for windows) */ + fn_format(src_path, src_path, "", "", MYF(MY_UNPACK_FILENAME)); if (access(src_path, F_OK)) { my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table); @@ -2299,7 +2302,9 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, } else { - fn_format( dst_path, table_name, db, reg_ext, MYF(MY_UNPACK_FILENAME)); + strxmov(dst_path, mysql_data_home, "/", db, "/", table_name, + reg_ext, NullS); + fn_format(dst_path, dst_path, "", "", MYF(MY_UNPACK_FILENAME)); if (!access(dst_path, F_OK)) goto table_exists; } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 0ec71bdfba3..663f2d2be34 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -167,7 +167,10 @@ int mysql_update(THD *thd, else if ((used_index=table->file->key_used_on_scan) < MAX_KEY) used_key_is_modified=check_if_key_used(table, used_index, fields); else + { used_key_is_modified=0; + used_index= MAX_KEY; + } if (used_key_is_modified || order) { /* |