522
1 error, transaction was rolled back
524
int ha_prepare(Session *session)
527
Session_TRANS *trans=all ? &session->transaction.all : &session->transaction.stmt;
528
Ha_trx_info *ha_info= trans->ha_list;
531
for (; ha_info; ha_info= ha_info->next())
534
StorageEngine *engine= ha_info->engine();
535
status_var_increment(session->status_var.ha_prepare_count);
536
if ((err= engine->prepare(session, all)))
538
my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
539
ha_rollback_trans(session, all);
545
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
546
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
547
engine->getName().c_str());
555
519
Check if we can skip the two-phase commit.
557
521
A helper function to evaluate if two-phase commit is mandatory.
1850
1814
return(table->file->errkey);
1855
Delete all files with extension from bas_ext().
1857
@param name Base name of table
1860
We assume that the handler may return more extensions than
1861
was actually used for the file.
1864
0 If we successfully deleted at least one file from base_ext and
1865
didn't get any other errors than ENOENT
1869
int handler::delete_table(const char *name)
1872
int enoent_or_zero= ENOENT; // Error if no file was deleted
1873
char buff[FN_REFLEN];
1875
for (const char **ext=bas_ext(); *ext ; ext++)
1877
fn_format(buff, name, "", *ext, MY_UNPACK_FILENAME|MY_APPEND_EXT);
1878
if (my_delete_with_symlink(buff, MYF(0)))
1880
if ((error= my_errno) != ENOENT)
1884
enoent_or_zero= 0; // No error for ENOENT
1885
error= enoent_or_zero;
1891
int handler::rename_table(const char * from, const char * to)
1894
for (const char **ext= bas_ext(); *ext ; ext++)
1896
if (rename_file_ext(from, to, *ext))
1898
if ((error=my_errno) != ENOENT)
1907
1817
void handler::drop_table(const char *name)
1820
engine->deleteTable(ha_session(), name);
1955
1865
table_share can be NULL in ha_delete_table(). See implementation
1956
1866
of standalone function ha_delete_table() in sql_base.cc.
1958
if (table_share == NULL || table_share->tmp_table == NO_TMP_TABLE)
1868
// if (table_share == NULL || table_share->tmp_table == NO_TMP_TABLE)
1959
1869
ha_info->set_trx_read_write();
2131
2041
prepare_for_alter();
2136
Rename table: public interface.
2138
@sa handler::rename_table()
2142
handler::ha_rename_table(const char *from, const char *to)
2144
mark_trx_read_write();
2146
return rename_table(from, to);
2151
Delete table: public interface.
2153
@sa handler::delete_table()
2157
handler::ha_delete_table(const char *name)
2159
mark_trx_read_write();
2161
return delete_table(name);
2166
2045
Drop table in the engine: public interface.
2176
2055
return drop_table(name);
2181
Create a table in the engine: public interface.
2183
@sa handler::create()
2187
handler::ha_create(const char *name, Table *form, HA_CREATE_INFO *create_info)
2189
mark_trx_read_write();
2191
return create(name, form, create_info);
2195
2059
Tell the storage engine that it is allowed to "disable transaction" in the
2196
2060
handler. It is a hint that ACID is not required - it is used in NDB for