diff options
author | petr/cps@mysql.com/owlet <> | 2006-08-18 16:48:32 +0400 |
---|---|---|
committer | petr/cps@mysql.com/owlet <> | 2006-08-18 16:48:32 +0400 |
commit | 30ef47a93c0736d6bbdf41e29fdd57b111c52bfe (patch) | |
tree | a37679ea94e429f80d2f30b7b2da16ba90512ff5 /sql/examples | |
parent | 64092ca93b0c898b668af2f4b27f61ab354f511d (diff) | |
parent | 472279cec426b4ea97d4e11690293e86986cfd57 (diff) | |
download | mariadb-git-30ef47a93c0736d6bbdf41e29fdd57b111c52bfe.tar.gz |
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/cps/mysql/trees/mysql-5.0-virgin
Diffstat (limited to 'sql/examples')
-rw-r--r-- | sql/examples/ha_tina.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 524ce5eb693..f727cefc6d0 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -205,16 +205,18 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table) share->table_name_length=length; share->table_name=tmp_name; strmov(share->table_name,table_name); - fn_format(data_file_name, table_name, "", ".CSV",MY_REPLACE_EXT|MY_UNPACK_FILENAME); + fn_format(data_file_name, table_name, "", ".CSV", + MY_REPLACE_EXT | MY_UNPACK_FILENAME); + + if ((share->data_file= my_open(data_file_name, O_RDWR|O_APPEND, + MYF(0))) == -1) + goto error; + if (my_hash_insert(&tina_open_tables, (byte*) share)) goto error; thr_lock_init(&share->lock); pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST); - if ((share->data_file= my_open(data_file_name, O_RDWR|O_APPEND, - MYF(0))) == -1) - goto error2; - /* We only use share->data_file for writing, so we scan to the end to append */ if (my_seek(share->data_file, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR) goto error2; @@ -233,6 +235,7 @@ error3: error2: thr_lock_delete(&share->lock); pthread_mutex_destroy(&share->mutex); + hash_delete(&tina_open_tables, (byte*) share); error: pthread_mutex_unlock(&tina_mutex); my_free((gptr) share, MYF(0)); |