[Maria-developers] MDEV-10598 - bb-10.2-compatibility
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ? Regards, Jérôme.
Hello Jerome, Thank you very much for the patch. I'm reviewing it. But most likely won't finish today. I'll be away on Thursday and Friday. Will reply in the beginning of the next week. Btw, the implementation of stored routines was new for me when I started the compatibility project. Now gradually learning this code. But some parts are still not clear for me. For example, I don't know *why* it was disallowed to have variable declarations after cursor declarations. Did you figure out this? Thanks. On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
Regards, Jérôme.
Hello Alexander, I did not search why. There must be a good reason but it is probably at runtime. I just deferred the cursor declaration to the right place. Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : mercredi 22 février 2017 13:27 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
Thank you very much for the patch. I'm reviewing it. But most likely won't finish today. I'll be away on Thursday and Friday. Will reply in the beginning of the next week.
Btw, the implementation of stored routines was new for me when I started the compatibility project. Now gradually learning this code. But some parts are still not clear for me. For example, I don't know *why* it was disallowed to have variable declarations after cursor declarations. Did you figure out this?
Thanks.
On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
Regards, Jérôme.
Hello Jerome, On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
It seems we'll have to postpone this patch. I'm currently working on: MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important. Example: DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END; So the order of cur1, v and cur2 is important. I'll let you known when I'm ready with %ROWTYPE tasks. Thanks!
Regards, Jérôme.
Hello Alexander, Thanks for the explanation. It's something we do not use. I did not think about it. I look forward to your patch. Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 27 février 2017 11:28 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
It seems we'll have to postpone this patch.
I'm currently working on:
MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important.
Example:
DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END;
So the order of cur1, v and cur2 is important.
I'll let you known when I'm ready with %ROWTYPE tasks.
Thanks!
Regards, Jérôme.
Hello Jerome, On 02/27/2017 11:39 PM, jerome brauge wrote:
Hello Alexander, Thanks for the explanation. It's something we do not use. I did not think about it. I look forward to your patch.
I pushed these tasks: MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations Please clone the branch again. Git pull will not work, because I recently rebased bb-10.2-compatibility on top of the latest 10.2. When implementing cursor%ROWTYPE, I had your patch in mind and made some refactoring to help us apply MDEV-10598 easier. Please see a comment to MDEV-12011 in "git log". Now the tricky thing (when adding your patch) is to make sure that this work fine: CREATE PROCEDURE p1 AS a INT:=10; CURSOR cur1 IS SELECT a; rec1 cur1%ROWTYPE; CURSOR cur2 IS SELECT rec1.a; rec2 cur2%ROWTYPE; BEGIN OPEN cur2; FETCH cur2 INTO rec2; CLOSE cur2; SELECT rec2.a; END; I.e. a set of intermixed CURSOR and cursor%ROWTYPE variable declarations referencing each other recursively. Thanks.
Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 27 février 2017 11:28 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
It seems we'll have to postpone this patch.
I'm currently working on:
MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important.
Example:
DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END;
So the order of cur1, v and cur2 is important.
I'll let you known when I'm ready with %ROWTYPE tasks.
Thanks!
Regards, Jérôme.
Hello Alexander, Thanks for this good job. The build fail on Windows because there is a duplicate definition of char_to_byte_length_safe in item.h and sql_type.h: 1>c:\source\repos\server\sql\item.h(101): error C2084: function 'uint32 char_to_byte_length_safe(uint32,uint32)' already has a body 1> c:\source\repos\server\sql\sql_type.h(184): note: see previous definition of 'char_to_byte_length_safe' 1>c:\source\repos\server\sql\item.h(1751): error C2568: '=': unable to resolve function overload 1> c:\source\repos\server\sql\item.h(1751): note: could be 'uint32 char_to_byte_length_safe(uint32,uint32)' I quickly installed a CenOS 7 VM and build works fine but I don't know development tools under linux. Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : vendredi 10 mars 2017 11:36 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/27/2017 11:39 PM, jerome brauge wrote:
Hello Alexander, Thanks for the explanation. It's something we do not use. I did not think about it. I look forward to your patch.
I pushed these tasks:
MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
Please clone the branch again. Git pull will not work, because I recently rebased bb-10.2-compatibility on top of the latest 10.2.
When implementing cursor%ROWTYPE, I had your patch in mind and made some refactoring to help us apply MDEV-10598 easier. Please see a comment to MDEV-12011 in "git log".
Now the tricky thing (when adding your patch) is to make sure that this work fine:
CREATE PROCEDURE p1 AS a INT:=10; CURSOR cur1 IS SELECT a; rec1 cur1%ROWTYPE; CURSOR cur2 IS SELECT rec1.a; rec2 cur2%ROWTYPE; BEGIN OPEN cur2; FETCH cur2 INTO rec2; CLOSE cur2; SELECT rec2.a; END;
I.e. a set of intermixed CURSOR and cursor%ROWTYPE variable declarations referencing each other recursively.
Thanks.
Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 27 février 2017 11:28 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
It seems we'll have to postpone this patch.
I'm currently working on:
MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable
declarations
So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important.
Example:
DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END;
So the order of cur1, v and cur2 is important.
I'll let you known when I'm ready with %ROWTYPE tasks.
Thanks!
Regards, Jérôme.
Hi Jerome, On 03/11/2017 10:18 AM, jerome brauge wrote:
Hello Alexander,
Thanks for this good job. The build fail on Windows because there is a duplicate definition of char_to_byte_length_safe in item.h and sql_type.h:
1>c:\source\repos\server\sql\item.h(101): error C2084: function 'uint32 char_to_byte_length_safe(uint32,uint32)' already has a body 1> c:\source\repos\server\sql\sql_type.h(184): note: see previous definition of 'char_to_byte_length_safe' 1>c:\source\repos\server\sql\item.h(1751): error C2568: '=': unable to resolve function overload 1> c:\source\repos\server\sql\item.h(1751): note: could be 'uint32 char_to_byte_length_safe(uint32,uint32)'
I quickly installed a CenOS 7 VM and build works fine but I don't know development tools under linux.
Can you please try to remove the duplicate implementation from item.h ? Does this help? Thanks!
Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : vendredi 10 mars 2017 11:36 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/27/2017 11:39 PM, jerome brauge wrote:
Hello Alexander, Thanks for the explanation. It's something we do not use. I did not think about it. I look forward to your patch.
I pushed these tasks:
MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
Please clone the branch again. Git pull will not work, because I recently rebased bb-10.2-compatibility on top of the latest 10.2.
When implementing cursor%ROWTYPE, I had your patch in mind and made some refactoring to help us apply MDEV-10598 easier. Please see a comment to MDEV-12011 in "git log".
Now the tricky thing (when adding your patch) is to make sure that this work fine:
CREATE PROCEDURE p1 AS a INT:=10; CURSOR cur1 IS SELECT a; rec1 cur1%ROWTYPE; CURSOR cur2 IS SELECT rec1.a; rec2 cur2%ROWTYPE; BEGIN OPEN cur2; FETCH cur2 INTO rec2; CLOSE cur2; SELECT rec2.a; END;
I.e. a set of intermixed CURSOR and cursor%ROWTYPE variable declarations referencing each other recursively.
Thanks.
Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 27 février 2017 11:28 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
It seems we'll have to postpone this patch.
I'm currently working on:
MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable
declarations
So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important.
Example:
DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END;
So the order of cur1, v and cur2 is important.
I'll let you known when I'm ready with %ROWTYPE tasks.
Thanks!
Regards, Jérôme.
Alexander, It's work fine now. Regards. Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : samedi 11 mars 2017 07:43 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hi Jerome,
On 03/11/2017 10:18 AM, jerome brauge wrote:
Hello Alexander,
Thanks for this good job. The build fail on Windows because there is a duplicate definition of char_to_byte_length_safe in item.h and sql_type.h:
1>c:\source\repos\server\sql\item.h(101): error C2084: function 1>'uint32 char_to_byte_length_safe(uint32,uint32)' already has a body 1> c:\source\repos\server\sql\sql_type.h(184): note: see previous definition of 'char_to_byte_length_safe' 1>c:\source\repos\server\sql\item.h(1751): error C2568: '=': unable to 1>resolve function overload 1> c:\source\repos\server\sql\item.h(1751): note: could be 'uint32 char_to_byte_length_safe(uint32,uint32)'
I quickly installed a CenOS 7 VM and build works fine but I don't know development tools under linux.
Can you please try to remove the duplicate implementation from item.h ?
Does this help?
Thanks!
Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : vendredi 10 mars 2017 11:36 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/27/2017 11:39 PM, jerome brauge wrote:
Hello Alexander, Thanks for the explanation. It's something we do not use. I did not think about it. I look forward to your patch.
I pushed these tasks:
MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable
declarations
MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
Please clone the branch again. Git pull will not work, because I recently rebased bb-10.2-compatibility on top of the latest 10.2.
When implementing cursor%ROWTYPE, I had your patch in mind and made some refactoring to help us apply MDEV-10598 easier. Please see a comment to MDEV-12011 in "git log".
Now the tricky thing (when adding your patch) is to make sure that this work fine:
CREATE PROCEDURE p1 AS a INT:=10; CURSOR cur1 IS SELECT a; rec1 cur1%ROWTYPE; CURSOR cur2 IS SELECT rec1.a; rec2 cur2%ROWTYPE; BEGIN OPEN cur2; FETCH cur2 INTO rec2; CLOSE cur2; SELECT rec2.a; END;
I.e. a set of intermixed CURSOR and cursor%ROWTYPE variable declarations referencing each other recursively.
Thanks.
Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 27 février 2017 11:28 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
It seems we'll have to postpone this patch.
I'm currently working on:
MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable
declarations
So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important.
Example:
DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END;
So the order of cur1, v and cur2 is important.
I'll let you known when I'm ready with %ROWTYPE tasks.
Thanks!
Regards, Jérôme.
Hi Jerome, On 03/11/2017 05:17 PM, jerome brauge wrote:
Alexander, It's work fine now.
I pushed a clean-up patch to bb-10.2-ext. The second copy of char_to_byte_length_safe() unintentionally got in during a merge. The patch will later propagate to bb-10.2-compatibility (when I rebase it next time). Thanks for reporting the problem!
Regards. Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : samedi 11 mars 2017 07:43 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hi Jerome,
On 03/11/2017 10:18 AM, jerome brauge wrote:
Hello Alexander,
Thanks for this good job. The build fail on Windows because there is a duplicate definition of char_to_byte_length_safe in item.h and sql_type.h:
1>c:\source\repos\server\sql\item.h(101): error C2084: function 1>'uint32 char_to_byte_length_safe(uint32,uint32)' already has a body 1> c:\source\repos\server\sql\sql_type.h(184): note: see previous definition of 'char_to_byte_length_safe' 1>c:\source\repos\server\sql\item.h(1751): error C2568: '=': unable to 1>resolve function overload 1> c:\source\repos\server\sql\item.h(1751): note: could be 'uint32 char_to_byte_length_safe(uint32,uint32)'
I quickly installed a CenOS 7 VM and build works fine but I don't know development tools under linux.
Can you please try to remove the duplicate implementation from item.h ?
Does this help?
Thanks!
Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : vendredi 10 mars 2017 11:36 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/27/2017 11:39 PM, jerome brauge wrote:
Hello Alexander, Thanks for the explanation. It's something we do not use. I did not think about it. I look forward to your patch.
I pushed these tasks:
MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable
declarations
MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
Please clone the branch again. Git pull will not work, because I recently rebased bb-10.2-compatibility on top of the latest 10.2.
When implementing cursor%ROWTYPE, I had your patch in mind and made some refactoring to help us apply MDEV-10598 easier. Please see a comment to MDEV-12011 in "git log".
Now the tricky thing (when adding your patch) is to make sure that this work fine:
CREATE PROCEDURE p1 AS a INT:=10; CURSOR cur1 IS SELECT a; rec1 cur1%ROWTYPE; CURSOR cur2 IS SELECT rec1.a; rec2 cur2%ROWTYPE; BEGIN OPEN cur2; FETCH cur2 INTO rec2; CLOSE cur2; SELECT rec2.a; END;
I.e. a set of intermixed CURSOR and cursor%ROWTYPE variable declarations referencing each other recursively.
Thanks.
Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 27 février 2017 11:28 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/21/2017 07:18 PM, jerome brauge wrote: > Hello Alexander, > I've done this patch for MDEV-10598. > Can you review it ?
It seems we'll have to postpone this patch.
I'm currently working on:
MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable
declarations
So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important.
Example:
DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END;
So the order of cur1, v and cur2 is important.
I'll let you known when I'm ready with %ROWTYPE tasks.
Thanks!
> > Regards, > Jérôme. >
Hello Jerome, will you try to apply your patch on top of the current bb-10.2-compatibility? Or should I do that? Thanks! On 03/10/2017 02:36 PM, Alexander Barkov wrote:
Hello Jerome,
On 02/27/2017 11:39 PM, jerome brauge wrote:
Hello Alexander, Thanks for the explanation. It's something we do not use. I did not think about it. I look forward to your patch.
I pushed these tasks:
MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
Please clone the branch again. Git pull will not work, because I recently rebased bb-10.2-compatibility on top of the latest 10.2.
When implementing cursor%ROWTYPE, I had your patch in mind and made some refactoring to help us apply MDEV-10598 easier. Please see a comment to MDEV-12011 in "git log".
Now the tricky thing (when adding your patch) is to make sure that this work fine:
CREATE PROCEDURE p1 AS a INT:=10; CURSOR cur1 IS SELECT a; rec1 cur1%ROWTYPE; CURSOR cur2 IS SELECT rec1.a; rec2 cur2%ROWTYPE; BEGIN OPEN cur2; FETCH cur2 INTO rec2; CLOSE cur2; SELECT rec2.a; END;
I.e. a set of intermixed CURSOR and cursor%ROWTYPE variable declarations referencing each other recursively.
Thanks.
Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 27 février 2017 11:28 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
It seems we'll have to postpone this patch.
I'm currently working on:
MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important.
Example:
DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END;
So the order of cur1, v and cur2 is important.
I'll let you known when I'm ready with %ROWTYPE tasks.
Thanks!
Regards, Jérôme.
Hello Alexander, I have to do some changes in the patch and add some tests cases (with row type) I think it will be ready this afternoon (CET). Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 13 mars 2017 14:38 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
will you try to apply your patch on top of the current bb-10.2-compatibility?
Or should I do that?
Thanks!
On 03/10/2017 02:36 PM, Alexander Barkov wrote:
Hello Jerome,
On 02/27/2017 11:39 PM, jerome brauge wrote:
Hello Alexander, Thanks for the explanation. It's something we do not use. I did not think about it. I look forward to your patch.
I pushed these tasks:
MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations MDEV-12133 sql_mode=ORACLE: table%ROWTYPE in variable declarations
Please clone the branch again. Git pull will not work, because I recently rebased bb-10.2-compatibility on top of the latest 10.2.
When implementing cursor%ROWTYPE, I had your patch in mind and made some refactoring to help us apply MDEV-10598 easier. Please see a comment to MDEV-12011 in "git log".
Now the tricky thing (when adding your patch) is to make sure that this work fine:
CREATE PROCEDURE p1 AS a INT:=10; CURSOR cur1 IS SELECT a; rec1 cur1%ROWTYPE; CURSOR cur2 IS SELECT rec1.a; rec2 cur2%ROWTYPE; BEGIN OPEN cur2; FETCH cur2 INTO rec2; CLOSE cur2; SELECT rec2.a; END;
I.e. a set of intermixed CURSOR and cursor%ROWTYPE variable declarations referencing each other recursively.
Thanks.
Regards, Jérôme.
-----Message d'origine----- De : Alexander Barkov [mailto:bar@mariadb.org] Envoyé : lundi 27 février 2017 11:28 À : jerome brauge Cc : maria-developers Objet : Re: MDEV-10598 - bb-10.2-compatibility
Hello Jerome,
On 02/21/2017 07:18 PM, jerome brauge wrote:
Hello Alexander, I've done this patch for MDEV-10598. Can you review it ?
It seems we'll have to postpone this patch.
I'm currently working on:
MDEV-10598 Variable declarations can go after cursor declarations MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable
declarations
So the trick with postponing variable declarations using a temporary list might not work properly after adding MDEV-10598 abd MDEV-12011, the order of cursors and variables is important.
Example:
DECLARE CURSOR cur1 IS SELECT a,b FROM t1; v cur1%ROWTYPE; CURSOR cur2 IS SELECT v.a, v.b FROM DUAL; BEGIN ... END;
So the order of cur1, v and cur2 is important.
I'll let you known when I'm ready with %ROWTYPE tasks.
Thanks!
Regards, Jérôme.
participants (2)
-
Alexander Barkov
-
jerome brauge