Re: [Maria-developers] 3eceb51: MDEV-7990: ERROR 1526 when procedure executed for second time ALTER TABLE partition ... pMAX values less than MAXVALUE
Hi, Sanja! On May 06, sanja@mariadb.com wrote:
revision-id: 3eceb51e697d5a514e70c374a06e7eef6b5a37a0 parent(s): aa5095627e2619bdad7916d33d1016802a84a9e1 committer: Oleksandr Byelkin branch nick: server timestamp: 2015-05-06 13:19:22 +0200 message:
MDEV-7990: ERROR 1526 when procedure executed for second time ALTER TABLE partition ... pMAX values less than MAXVALUE
Added cleaning partition data which are saved in LEX structure to make possible correct re-execution of a SP or PS using the code.
No, this is wrong. See prep_alter_part_table(). The first thing it does it to copy thd->lex->part_info to thd->work_part_info. It tries to do a deep copy to be able to modify it freely, but apparently the copy isn't deep enough. I see two options 1. Do a deeper copy. Duplicate all value lists. 2. Make part_column_list_val elements immutable. That would be preferred, of course, but I'm not sure it's possible. Regards, Sergei
Hi, Sergei! On 12.06.15 13:09, Sergei Golubchik wrote:
Hi, Sanja!
On May 06, sanja@mariadb.com wrote:
revision-id: 3eceb51e697d5a514e70c374a06e7eef6b5a37a0 parent(s): aa5095627e2619bdad7916d33d1016802a84a9e1 committer: Oleksandr Byelkin branch nick: server timestamp: 2015-05-06 13:19:22 +0200 message:
MDEV-7990: ERROR 1526 when procedure executed for second time ALTER TABLE partition ... pMAX values less than MAXVALUE
Added cleaning partition data which are saved in LEX structure to make possible correct re-execution of a SP or PS using the code. No, this is wrong. See prep_alter_part_table(). The first thing it does it to copy thd->lex->part_info to thd->work_part_info. It tries to do a deep copy to be able to modify it freely, but apparently the copy isn't deep enough. I see two options What is wrong? I modified clone procedure which used for getting work_part_info deeper copy which is following case 1.
Here is the code in prep_alter_table() if (thd->work_part_info && !(thd->work_part_info= thd->lex->part_info->get_clone())) DBUG_RETURN(TRUE); and I changed get_clone() method.
1. Do a deeper copy. Duplicate all value lists.
2. Make part_column_list_val elements immutable. That would be preferred, of course, but I'm not sure it's possible.
Regards, Sergei
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Hi, Oleksandr! On Aug 05, Oleksandr Byelkin wrote: > On 12.06.15 13:09, Sergei Golubchik wrote: > > Hi, Sanja! > > > > On May 06, sanja@mariadb.com wrote: > >> revision-id: 3eceb51e697d5a514e70c374a06e7eef6b5a37a0 > >> parent(s): aa5095627e2619bdad7916d33d1016802a84a9e1 > >> committer: Oleksandr Byelkin > >> branch nick: server > >> timestamp: 2015-05-06 13:19:22 +0200 > >> message: > >> > >> MDEV-7990: ERROR 1526 when procedure executed for second time ALTER > >> TABLE partition ... pMAX values less than MAXVALUE > >> > >> Added cleaning partition data which are saved in LEX structure to make > >> possible correct re-execution of a SP or PS using the code. > > No, this is wrong. See prep_alter_part_table(). The first thing it does > > it to copy thd->lex->part_info to thd->work_part_info. It tries to do a > > deep copy to be able to modify it freely, but apparently the copy isn't > > deep enough. I see two options > > 1. Do a deeper copy. Duplicate all value lists. > > 2. Make part_column_list_val elements immutable. That would be > > preferred, of course, but I'm not sure it's possible. > What is wrong? I modified clone procedure which used for getting > work_part_info deeper copy which is following case 1. That's fine, but there should be no cleanup. The original design was to create a deep copy of the structure. Then this copy can be modified arbitrarily and later discarded without affecting the original. But your cleanup, as far as I can see, is like doing the changes in the original and then restoring the structure back to its initial state. So, part of the structure is deep-copied but the leaves are modified in place and are later "cleaned up". You've got two different approaches applied to different levels of the part_info - and that was what I didn't like. Regards, Sergei
participants (2)
-
Oleksandr Byelkin
-
Sergei Golubchik