Skip to content

Commit 07ec1a9

Browse files
committed
cleanup: unused function argument
1 parent aa09cb3 commit 07ec1a9

File tree

11 files changed

+12
-96
lines changed

11 files changed

+12
-96
lines changed

sql/datadict.cc

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ static int read_string(File file, uchar**to, size_t length)
5757
*/
5858

5959
Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name,
60-
LEX_CSTRING *partition_engine_name,
6160
LEX_CUSTRING *table_version)
6261
{
6362
File file;
@@ -86,11 +85,6 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name,
8685
engine_name->length= 0;
8786
((char*) (engine_name->str))[0]= 0;
8887
}
89-
if (partition_engine_name)
90-
{
91-
partition_engine_name->length= 0;
92-
partition_engine_name->str= 0;
93-
}
9488
if (table_version)
9589
{
9690
table_version->length= 0;
@@ -133,25 +127,10 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name,
133127
{
134128
if (engine_name)
135129
*engine_name= hton2plugin[ht->slot]->name;
136-
#ifdef WITH_PARTITION_STORAGE_ENGINE
137-
if (partition_engine_name && dbt == DB_TYPE_PARTITION_DB)
138-
{
139-
handlerton *p_ht;
140-
legacy_db_type new_dbt= (legacy_db_type) header[61];
141-
if (new_dbt >= DB_TYPE_FIRST_DYNAMIC)
142-
goto cont;
143-
if (!(p_ht= ha_resolve_by_legacy_type(thd, new_dbt)))
144-
goto err;
145-
*partition_engine_name= *hton_name(p_ht);
146-
}
147-
#endif // WITH_PARTITION_STORAGE_ENGINE
148130
goto err;
149131
}
150132
}
151133

152-
#ifdef WITH_PARTITION_STORAGE_ENGINE
153-
cont:
154-
#endif
155134
/* read the true engine name */
156135
if (engine_name)
157136
{
@@ -197,43 +176,6 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name,
197176
}
198177
}
199178

200-
#ifdef WITH_PARTITION_STORAGE_ENGINE
201-
if (partition_engine_name && dbt == DB_TYPE_PARTITION_DB)
202-
{
203-
uint len;
204-
const uchar *extra2;
205-
/* Length of the MariaDB extra2 segment in the form file. */
206-
len = uint2korr(frm_image+4);
207-
extra2= frm_image + 64;
208-
if (*extra2 != '/') // old frm had '/' there
209-
{
210-
const uchar *e2end= extra2 + len;
211-
while (extra2 + 3 <= e2end)
212-
{
213-
uchar type= *extra2++;
214-
size_t length= *extra2++;
215-
if (!length)
216-
{
217-
if (extra2 + 2 >= e2end)
218-
break;
219-
length= uint2korr(extra2);
220-
extra2+= 2;
221-
if (length < 256)
222-
break;
223-
}
224-
if (extra2 + length > e2end)
225-
break;
226-
if (type == EXTRA2_DEFAULT_PART_ENGINE)
227-
{
228-
partition_engine_name->str= thd->strmake((char*)extra2, length);
229-
partition_engine_name->length= length;
230-
break;
231-
}
232-
extra2+= length;
233-
}
234-
}
235-
}
236-
#endif // WITH_PARTITION_STORAGE_ENGINE
237179
my_free(frm_image);
238180
}
239181

sql/datadict.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ enum Table_type
3939
*/
4040

4141
enum Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name,
42-
LEX_CSTRING *partition_engine_name,
4342
LEX_CUSTRING *table_version);
4443

4544
static inline bool dd_frm_is_view(THD *thd, char *path)
4645
{
47-
return dd_frm_type(thd, path, NULL, NULL, NULL) == TABLE_TYPE_VIEW;
46+
return dd_frm_type(thd, path, NULL, NULL) == TABLE_TYPE_VIEW;
4847
}
4948

5049
bool dd_recreate_table(THD *thd, const char *db, const char *table_name);

sql/handler.cc

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6660,7 +6660,6 @@ static my_bool discover_existence(THD *thd, plugin_ref plugin,
66606660

66616661
bool ha_table_exists(THD *thd, const LEX_CSTRING *db,
66626662
const LEX_CSTRING *table_name, LEX_CUSTRING *table_id,
6663-
LEX_CSTRING *partition_engine_name,
66646663
handlerton **hton, bool *is_sequence)
66656664
{
66666665
handlerton *dummy;
@@ -6686,21 +6685,6 @@ bool ha_table_exists(THD *thd, const LEX_CSTRING *db,
66866685
if (!hton)
66876686
hton= &dummy;
66886687
*hton= element->share->db_type();
6689-
#ifdef WITH_PARTITION_STORAGE_ENGINE
6690-
if (partition_engine_name && element->share->db_type() == partition_hton)
6691-
{
6692-
if (!static_cast<Partition_share *>(element->share->ha_share)->
6693-
partition_engine_name)
6694-
{
6695-
/* Partition engine found, but table has never been opened */
6696-
tdc_unlock_share(element);
6697-
goto retry_from_frm;
6698-
}
6699-
lex_string_set(partition_engine_name,
6700-
static_cast<Partition_share *>(element->share->ha_share)->
6701-
partition_engine_name);
6702-
}
6703-
#endif
67046688
*is_sequence= element->share->table_type == TABLE_TYPE_SEQUENCE;
67056689
if (*hton != view_pseudo_hton && element->share->tabledef_version.length &&
67066690
table_id &&
@@ -6711,9 +6695,6 @@ bool ha_table_exists(THD *thd, const LEX_CSTRING *db,
67116695
DBUG_RETURN(TRUE);
67126696
}
67136697

6714-
#ifdef WITH_PARTITION_STORAGE_ENGINE
6715-
retry_from_frm:
6716-
#endif
67176698
char path[FN_REFLEN + 1];
67186699
size_t path_len = build_table_filename(path, sizeof(path) - 1,
67196700
db->str, table_name->str, "", 0);
@@ -6726,9 +6707,7 @@ bool ha_table_exists(THD *thd, const LEX_CSTRING *db,
67266707
{
67276708
char engine_buf[NAME_CHAR_LEN + 1];
67286709
LEX_CSTRING engine= { engine_buf, 0 };
6729-
Table_type type= dd_frm_type(thd, path, &engine,
6730-
partition_engine_name,
6731-
table_id);
6710+
Table_type type= dd_frm_type(thd, path, &engine, table_id);
67326711

67336712
switch (type) {
67346713
case TABLE_TYPE_UNKNOWN:

sql/handler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5694,7 +5694,6 @@ int ha_discover_table_names(THD *thd, const LEX_CSTRING *db, MY_DIR *dirp,
56945694
bool ha_table_exists(THD *thd, const LEX_CSTRING *db,
56955695
const LEX_CSTRING *table_name,
56965696
LEX_CUSTRING *table_version= 0,
5697-
LEX_CSTRING *partition_engine_name= 0,
56985697
handlerton **hton= 0, bool *is_sequence= 0);
56995698
bool ha_check_if_updates_are_ignored(THD *thd, handlerton *hton,
57005699
const char *op);

sql/sql_base.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4292,7 +4292,7 @@ static bool upgrade_lock_if_not_exists(THD *thd,
42924292
DEBUG_SYNC(thd,"create_table_before_check_if_exists");
42934293
if (!create_info.or_replace() &&
42944294
ha_table_exists(thd, &create_table->db, &create_table->table_name,
4295-
NULL, NULL, &create_table->db_type))
4295+
NULL, &create_table->db_type))
42964296
{
42974297
if (create_info.if_not_exists())
42984298
{

sql/sql_plugin.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,8 +1715,7 @@ int plugin_init(int *argc, char **argv, int flags)
17151715
{
17161716
char path[FN_REFLEN + 1];
17171717
build_table_filename(path, sizeof(path) - 1, "mysql", "plugin", reg_ext, 0);
1718-
Table_type ttype= dd_frm_type(0, path, &plugin_table_engine_name,
1719-
NULL, NULL);
1718+
Table_type ttype= dd_frm_type(0, path, &plugin_table_engine_name, NULL);
17201719
if (ttype != TABLE_TYPE_NORMAL)
17211720
plugin_table_engine_name=empty_clex_str;
17221721
}

sql/sql_rename.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ check_rename(THD *thd, rename_param *param,
283283
DBUG_ASSERT(param->new_alias.str);
284284

285285
if (!ha_table_exists(thd, &ren_table->db, &param->old_alias,
286-
&param->old_version, NULL,
287-
&param->from_table_hton) ||
286+
&param->old_version, &param->from_table_hton) ||
288287
!param->from_table_hton)
289288
{
290289
my_error(ER_NO_SUCH_TABLE, MYF(if_exists ? ME_NOTE : 0),
@@ -304,7 +303,7 @@ check_rename(THD *thd, rename_param *param,
304303
DBUG_RETURN(-1);
305304
}
306305

307-
if (ha_table_exists(thd, &new_db, &param->new_alias, NULL, NULL, 0))
306+
if (ha_table_exists(thd, &new_db, &param->new_alias))
308307
{
309308
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), param->new_alias.str);
310309
DBUG_RETURN(1); // This can't be skipped

sql/sql_show.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4735,7 +4735,7 @@ static void get_table_engine_for_i_s(THD *thd, char *buf, TABLE_LIST *tl,
47354735
char path[FN_REFLEN];
47364736
build_table_filename(path, sizeof(path) - 1,
47374737
db->str, table->str, reg_ext, 0);
4738-
if (dd_frm_type(thd, path, &engine_name, NULL, NULL) == TABLE_TYPE_NORMAL)
4738+
if (dd_frm_type(thd, path, &engine_name, NULL) == TABLE_TYPE_NORMAL)
47394739
tl->option= engine_name.str;
47404740
}
47414741
}
@@ -4974,8 +4974,7 @@ static int fill_schema_table_names(THD *thd, TABLE_LIST *tables,
49744974
handlerton *hton;
49754975
bool is_sequence;
49764976

4977-
if (ha_table_exists(thd, db_name, table_name, NULL, NULL,
4978-
&hton, &is_sequence))
4977+
if (ha_table_exists(thd, db_name, table_name, NULL, &hton, &is_sequence))
49794978
{
49804979
if (hton == view_pseudo_hton)
49814980
table->field[3]->store(STRING_WITH_LEN("VIEW"), cs);

sql/sql_table.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables,
15641564
*/
15651565
char engine_buf[NAME_CHAR_LEN + 1];
15661566
LEX_CSTRING engine= { engine_buf, 0 };
1567-
table_type= dd_frm_type(thd, path, &engine, NULL, &version);
1567+
table_type= dd_frm_type(thd, path, &engine, &version);
15681568
if (table_type == TABLE_TYPE_NORMAL || table_type == TABLE_TYPE_SEQUENCE)
15691569
{
15701570
plugin_ref p= plugin_lock_by_name(thd, &engine,
@@ -4476,7 +4476,7 @@ int create_table_impl(THD *thd,
44764476
handlerton *db_type;
44774477
if (!internal_tmp_table &&
44784478
ha_table_exists(thd, &db, &table_name,
4479-
&create_info->org_tabledef_version, NULL, &db_type))
4479+
&create_info->org_tabledef_version, &db_type))
44804480
{
44814481
if (ha_check_if_updates_are_ignored(thd, db_type, "CREATE"))
44824482
{

sql/sql_trigger.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
574574
DBUG_ASSERT(tables->next_global == 0);
575575

576576
build_table_filename(path, sizeof(path) - 1, tables->db.str, tables->alias.str, ".frm", 0);
577-
tables->required_type= dd_frm_type(NULL, path, NULL, NULL, NULL);
577+
tables->required_type= dd_frm_type(NULL, path, NULL, NULL);
578578

579579
/* We do not allow creation of triggers on temporary tables or sequence. */
580580
if (tables->required_type == TABLE_TYPE_SEQUENCE ||

0 commit comments

Comments
 (0)