Fix issues relate to the select partition table

This commit is contained in:
lazio579 2019-01-15 16:29:20 +08:00
parent 33e259ee8a
commit d8a2ae253d
2 changed files with 5 additions and 1 deletions

View File

@ -754,7 +754,10 @@ proxy_parse_query(network_mysqld_con *con)
static int
wrap_check_sql(network_mysqld_con *con, struct sql_context_t *sql_context)
{
if (con->srv->is_partition_mode && con->sharding_plan->table_type == GLOBAL_TABLE) {
if (con->srv->is_partition_mode && sql_context->stmt_type != STMT_SELECT &&
con->sharding_plan->table_type == GLOBAL_TABLE)
{
g_debug("don't change sql for: %s", con->orig_sql->str);
return 0;
}

View File

@ -1103,6 +1103,7 @@ routing_select(sql_context_t *context, const sql_select_t *select,
}
}
g_ptr_array_free(sharding_tables, TRUE);
return USE_ALL_SHARDINGS;
}
}