Skip to content

Commit

Permalink
[fixup] post-merge spider fixup
Browse files Browse the repository at this point in the history
MDEV-32524: a couple missed magic numbers
MDEV-26247: a couple missed goto statements that could lead to memory leak
  • Loading branch information
mariadb-YuchenPei committed Dec 5, 2023
1 parent b97f4c3 commit ddd5449
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion storage/spider/spd_db_conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4786,7 +4786,7 @@ int spider_db_store_result_for_reuse_cursor(
THD *thd = current_thd;
char buf[MAX_FIELD_WIDTH];
spider_string tmp_str(buf, MAX_FIELD_WIDTH, &my_charset_bin);
tmp_str.init_calc_mem(120);
tmp_str.init_calc_mem(SPD_MID_DB_STORE_RESULT_FOR_REUSE_CURSOR_1);

DBUG_PRINT("info",("spider store result to temporary table"));
DBUG_ASSERT(!current->result_tmp_tbl);
Expand Down
2 changes: 1 addition & 1 deletion storage/spider/spd_db_mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3364,7 +3364,7 @@ int spider_db_mbase::set_loop_check(
spider_string sql_str(sql_buf, sizeof(sql_buf), &my_charset_bin);
DBUG_ENTER("spider_db_mbase::set_loop_check");
DBUG_PRINT("info",("spider this=%p", this));
sql_str.init_calc_mem(270);
sql_str.init_calc_mem(SPD_MID_DB_MBASE_SET_LOOP_CHECK_1);
while ((lcptr = (SPIDER_CONN_LOOP_CHECK *) my_hash_element(
&conn->loop_check_queue, 0)))
{
Expand Down
6 changes: 2 additions & 4 deletions storage/spider/spd_group_by_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1719,8 +1719,7 @@ group_by_handler *spider_create_group_by_handler(
if (spider->dml_init())
{
DBUG_PRINT("info",("spider can not init for dml"));
delete fields;
DBUG_RETURN(NULL);
goto skip_free_fields;
}
for (
roop_count = spider_conn_link_idx_next(share->link_statuses,
Expand Down Expand Up @@ -1792,8 +1791,7 @@ group_by_handler *spider_create_group_by_handler(
if (spider->dml_init())
{
DBUG_PRINT("info",("spider can not init for dml"));
delete fields;
DBUG_RETURN(NULL);
goto skip_free_fields;
}
for (
roop_count = spider_conn_link_idx_next(share->link_statuses,
Expand Down
2 changes: 2 additions & 0 deletions storage/spider/spd_include.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ enum spider_malloc_id {
SPD_MID_DB_MBASE_RESULT_FETCH_ROW_FROM_TMP_TABLE_3,
SPD_MID_DB_MBASE_ROW_APPEND_ESCAPED_TO_STR_1,
SPD_MID_DB_MBASE_ROW_CLONE_1,
SPD_MID_DB_MBASE_SET_LOOP_CHECK_1,
SPD_MID_DB_MBASE_SET_SQL_MODE_1,
SPD_MID_DB_MBASE_SET_TIME_ZONE_1,
SPD_MID_DB_MBASE_SET_WAIT_TIMEOUT_1,
Expand Down Expand Up @@ -412,6 +413,7 @@ enum spider_malloc_id {
SPD_MID_DB_STORE_RESULT_3,
SPD_MID_DB_STORE_RESULT_4,
SPD_MID_DB_STORE_RESULT_5,
SPD_MID_DB_STORE_RESULT_FOR_REUSE_CURSOR_1,
SPD_MID_DB_UDF_COPY_TABLES_1,
SPD_MID_DB_UDF_PING_TABLE_1,
SPD_MID_DB_UDF_PING_TABLE_2,
Expand Down

0 comments on commit ddd5449

Please sign in to comment.