← Back to team overview

maria-developers team mailing list archive

Re: MDEV-10598 - bb-10.2-compatibility

 

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@xxxxxxxxxxx]
> 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@xxxxxxxxxxx] 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.
> >>>


Follow ups

References