← Back to team overview

maria-developers team mailing list archive

Re: Working on spider patches, MDEV-7698

 

Hi Monty!

Please see comment at 2016-05-07 19:15 for patches for MariaDB 10.2.

> I don't think this it will work removing the usage of p_elem->connect_string
>
> This is because each partition may have a different connect string.

I understand this behavior. But  I don't think this overwriting is a
good idea. Because when an user writes both table's connect string and
partition's connect string, table's connect string is lost. This
behavior causes a confusion of an user.
In the other hand, Spider can read both table's connect string and
partition's connect string without overwriting. Spider uses table's
connect string for common settings and partition's connect string for
partition specific settings.
This is why this patch removes overwriting logic of connect string.

> As my_free is safe to call with NULL, the above is not needed

ok

> +#define PLUGIN_VAR_CAN_MEMALLOC
> +
>  #ifndef MYSQL_CLIENT
>
> The above is not needed, as all code that is testing this is doing:

Please move it under "#define SPIDER_HEX_VERSION" in
"storage/spider/spd_include.h" for now. This is checked in Spider
code.

> #if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100000
>
> Which is always true in MariaDB 10.x

Is this in Spider code, right?
This is needed for supporting other versions. Spider still supports MySQL 5.5.

Thanks,
Kentoku


2016-11-22 3:25 GMT+09:00 Michael Widenius <michael.widenius@xxxxxxxxx>:
> Hi!
>
> Now working on MDEV-7700 Spiral patch 002_mariadb-10.0.15.spider.diff
>
> +++ ./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 this 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;
> -    my_free(old);
> +    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
>
> Regards,
> Monty
>
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-developers
> Post to     : maria-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-developers
> More help   : https://help.launchpad.net/ListHelp


Follow ups

References