Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
Description:
enable table "connection" string with table partitioning feature.
support extra information "HA_EXTRA_WRITE_CAN_REPLACE" and
"HA_EXTRA_WRITE_CANNOT_REPLACE" for table partitioning feature.
support NULL for string variable with PLUGIN_VAR_MEMALLOC.
Effect:
All storage engine can use table "connection" string with table
partitioning feature by using this patch. Currently table "connection"
string is ignored by overwriting partition "connection" string. It is
for federatedx storage engine. But it should be implemented using
another way, because current implementation causes confusion for
users.
All storage engine can get extra information
"HA_EXTRA_WRITE_CAN_REPLACE" and "HA_EXTRA_WRITE_CANNOT_REPLACE" threw
table partitioning feature by using this patch.
Avoid to call my_free() using null pointer when string variable is
changed from null by using this patch.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Epic Link |
|
Fix Version/s | 10.1 [ 16100 ] |
Workflow | MariaDB v2 [ 60027 ] | MariaDB v3 [ 66993 ] |
Description |
Description: enable table "connection" string with table partitioning feature. support extra information "HA_EXTRA_WRITE_CAN_REPLACE" and "HA_EXTRA_WRITE_CANNOT_REPLACE" for table partitioning feature. support NULL for string variable with PLUGIN_VAR_MEMALLOC. Effect: All storage engine can use table "connection" string with table partitioning feature by using this patch. Currently table "connection" string is ignored by overwriting partition "connection" string. It is for federatedx storage engine. But it should be implemented using another way, because current implementation causes confusion for users. All storage engine can get extra information "HA_EXTRA_WRITE_CAN_REPLACE" and "HA_EXTRA_WRITE_CANNOT_REPLACE" threw table partitioning feature by using this patch. Avoid to call my_free() using null pointer when string variable is changed from null by using this patch. |
Fix Version/s | 10.1 [ 16100 ] |
Assignee | Michael Widenius [ monty ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Michael Widenius [ monty ] | Kentoku [ kentoku ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Labels | NRE-305367 |
Component/s | Storage Engine - Spider [ 10132 ] | |
Fix Version/s | N/A [ 14700 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Review [ 10002 ] | Closed [ 6 ] |
NRE Projects | NRE-305367 |
Labels | NRE-305367 |
Labels | spiral_p02 |
Workflow | MariaDB v3 [ 66993 ] | MariaDB v4 [ 132534 ] |
diff -Narup ./001_mariadb-10.1.8-partition_cond_push/sql/ha_partition.cc ./002_mariadb-10.1.8-spider/sql/ha_partition.cc
— ./001_mariadb-10.1.8-partition_cond_push/sql/ha_partition.cc 2015-10-14 01:48:30.223665318 +0900
+++ ./002_mariadb-10.1.8-spider/sql/ha_partition.cc 2015-10-14 01:48:53.392665313 +0900
@@ -327,7 +327,9 @@ void ha_partition::init_handler_variable
m_file_buffer= NULL;
m_name_buffer_ptr= NULL;
m_engine_array= NULL;
+/*
m_connect_string= NULL;
+*/
m_file= NULL;
m_file_tot_parts= 0;
m_reorged_file= NULL;
@@ -1516,4 +1518,6 @@ int ha_partition::prepare_new_partition(
if ((error= set_up_table_before_create(tbl, part_name, create_info, p_elem)))
goto error_create;
+/*
tbl->s->connect_string = p_elem->connect_string;
+*/
I don't think it will work removing the usage of p_elem->connect_string
This is because each partition may have a different connect string.
Here is an example from fedarated_partion.test:
eval create table t1 (s1 int primary key) engine=federated
partition by list (s1)
(partition p1 values in (1,3)
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_1',
partition p2 values in (2,4)
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1_2');
The above works in mariadb 10.2 but not in your spider tree.
From this patch I will, for now, only take the code related to
HA_EXTRA_WRITE_CAN_REPLACE
HA_EXTRA_WRITE_CANNOT_REPLACE
— ./001_mariadb-10.1.8-partition_cond_push/sql/sql_plugin.cc 2015-10-13 23:49:10.188129839 +0900
+++ ./002_mariadb-10.1.8-spider/sql/sql_plugin.cc 2015-10-14 01:48:54.296665317 +0900
@@ -2757,6 +2757,7 @@ static void update_func_str(THD *thd, st
(char*) tgt= my_strdup(value, MYF(0));
else
(char*) tgt= 0;
+ if (old)
+ my_free(old);
As my_free is safe to call with NULL, the above is not needed
diff -Narup ./001_mariadb-10.1.8-partition_cond_push/sql/sql_priv.h ./002_mariadb-10.1.8-spider/sql/sql_priv.h
— ./001_mariadb-10.1.8-partition_cond_push/sql/sql_priv.h 2015-10-13 23:49:10.189129839 +0900
+++ ./002_mariadb-10.1.8-spider/sql/sql_priv.h 2015-10-14 01:48:54.642665315 +0900
@@ -27,6 +27,8 @@
#ifndef SQL_PRIV_INCLUDED
#define SQL_PRIV_INCLUDED
+#define PLUGIN_VAR_CAN_MEMALLOC
+
#ifndef MYSQL_CLIENT
The above is not needed, as all code that is testing this is doing:
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100000
Which is always true in MariaDB 10.x