pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/45214: databases/mysql5-server (5.0.92nb1) recent patches botch (NetBSD < current)



>Number:         45214
>Category:       pkg
>Synopsis:       databases/mysql5-server (5.0.92nb1) recent patches botch 
>(NetBSD < current)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 04 06:55:00 +0000 2011
>Originator:     Robert Elz
>Release:        NetBSD 5.0   (pkgsrc current 2011-08-04)
>Organization:
        Prince of Songkla University
>Environment:
System: NetBSD jade.coe.psu.ac.th 5.1 NetBSD 5.1 (JADE-1.12-20101117) #5: Wed 
Nov 17 05:30:55 ICT 2010 
kre%jade.coe.psu.ac.th@localhost:/usr/obj/5.1/kernels/i386/JADE i386
Architecture: i386
Machine: i386
>Description:
        The recent patches added that shifted mysql5-server from
        version 4.0.92 to 5.0.92nb1 are utter garbage ...

        They work OK to fix the problem in the case they're designed
        to fix (that is, where sizeof(time_t) > 4) and so all will
        look OK on NetBSD -current (with 64 bit time_t's) but
        generate nonsense code in cases where sizeof(time_t) == 4
        (or < 4, but I don't think that's ever happened, anywhere).

        The problems are trivial to see by inspection of the
        two new patch files
                patches/patch-sql-common_my__time.c
                patches/patch-sql_set__var.cc

        Or they are, if you know to look (just think of how one
        should go about sticking #if*'s inside the middle of an
        expression...)

>How-To-Repeat:
        Attempt to build mysql5-server (5.0.92nb1) on anything
        with sizeof(time_t) <= 4 (lik, e.g.: NetBSD 5)

        Expect to see ...

c++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/pkg\"" 
-DMYSQL_DATADIR="\"/var/mysql\"" -DSHAREDIR="\"/usr/pkg/share/mysql\"" 
-DHAVE_CONFIG_H -I. -I../include -I/usr/include -I../innobase/include 
-I../innobase/include -I../include -I../include -I../regex -I.   -Dunix 
-I/usr/include -I/usr/pkg/include/mysql  -DDBUG_OFF -O2 -DUSE_OLD_FUNCTIONS 
-I/usr/include -I/usr/pkg/include/mysql   -fno-implicit-templates 
-fno-exceptions -fno-rtti -Dunix -c -o set_var.o set_var.cc
set_var.cc:2723:7: warning: extra tokens at end of #endif directive
set_var.cc: In member function 'virtual bool sys_var_timestamp::check(THD*, 
set_var*)':
set_var.cc:2724: error: expected `)' before '{' token
gmake[4]: *** [set_var.o] Error 1
gmake[4]: Leaving directory 
`/pkg_comp/obj/pkgsrc/databases/mysql5-server/5/mysql-5.0.92/sql'

        As always, make stops on the first error, if that one is
        corrected, there'll just be another from the other patch.
        (though the other at least doesn't include the #endif botch)

>Fix:
        Apply the patch below.   Because this is a patch to a patch,
        (or more correctly, to two patches, and a distinfo) and so.
        an unholy mess, I am including it both in simple text form
        (which if it were not for mangling by gnats would allow you
        to simply pipe this mail into patch to apply it), and which,
        if anyone is inclined to deal with the multiple levels of
        patch noise, they can simply read in the pkgsrc-bugs mail
        to see what the problem is/was, and verify my proposed fix,
        and also as a uuencoded form which might make extracting the
        patch from gnats mangling a little less like torture.

        Alternatively, you might find it easier to do what I did
        and just manually edit the patch files...

        I have not tested this on a system with 64 bit time_t's but
        I can't see how it can possibly cause problems.  With this
        patch it does return to building again on NetBSD 5.0/i386.

Index: distinfo
===================================================================
RCS file: /cvsroot/NetBSD/pkgsrc/databases/mysql5-server/distinfo,v
retrieving revision 1.27
diff -u -r1.27 distinfo
--- distinfo    2 Aug 2011 16:15:08 -0000       1.27
+++ distinfo    4 Aug 2011 06:30:28 -0000
@@ -24,7 +24,7 @@
 SHA1 (patch-include_my__time.h) = 369fb468388bdec4e8449927e2109a8839fdde8a
 SHA1 (patch-mysql-test_r_func__time.result) = 
c85c6ff7981adf9dd10a4d1724e0b94616dcbe1c
 SHA1 (patch-mysql-test_t_func__time.test) = 
5ff59d3fb9486a34ab23f33a942c2bd16be87776
-SHA1 (patch-sql-common_my__time.c) = 7056ca896030d26a30ba2c34a6adcd335fadfdb6
+SHA1 (patch-sql-common_my__time.c) = 8fa7f2f54cccf778c316e311dec8a39a87b9fc57
 SHA1 (patch-sql_mysqld.cc) = ae26b56f5ede21ed975005f47994b685b2c8083e
-SHA1 (patch-sql_set__var.cc) = 5dbbeeb5e3db648da395b372535e780da8ef294f
+SHA1 (patch-sql_set__var.cc) = 149b35a73c5b82094fc5188b872904aaeb9f2329
 SHA1 (patch-sql_sql__class.h) = 27fc6cc1684288b7ca517915af69a4ef8447c691
Index: patches/patch-sql-common_my__time.c
===================================================================
RCS file: 
/cvsroot/NetBSD/pkgsrc/databases/mysql5-server/patches/patch-sql-common_my__time.c,v
retrieving revision 1.1
diff -u -r1.1 patch-sql-common_my__time.c
--- patches/patch-sql-common_my__time.c 2 Aug 2011 16:15:08 -0000       1.1
+++ patches/patch-sql-common_my__time.c 4 Aug 2011 06:16:47 -0000
@@ -4,7 +4,7 @@
 
 --- sql-common/my_time.c.orig  2011-01-25 11:28:00.000000000 +0000
 +++ sql-common/my_time.c
-@@ -984,8 +984,16 @@ my_system_gmt_sec(const MYSQL_TIME *t_sr
+@@ -984,8 +984,17 @@ my_system_gmt_sec(const MYSQL_TIME *t_sr
      So, tmp < TIMESTAMP_MIN_VALUE will be triggered. On platfroms
      with unsigned time_t tmp+= shift*86400L might result in a number,
      larger then TIMESTAMP_MAX_VALUE, so another check will work.
@@ -17,8 +17,9 @@
 -  if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE))
 +  if ((tmp < TIMESTAMP_MIN_VALUE)
 +#if SIZEOF_TIME_T > 4
-+      || (tmp > TIMESTAMP_MAX_VALUE))
++      || (tmp > TIMESTAMP_MAX_VALUE)
 +#endif
++                                      )
      tmp= 0;
  
    return (my_time_t) tmp;
Index: patches/patch-sql_set__var.cc
===================================================================
RCS file: 
/cvsroot/NetBSD/pkgsrc/databases/mysql5-server/patches/patch-sql_set__var.cc,v
retrieving revision 1.1
diff -u -r1.1 patch-sql_set__var.cc
--- patches/patch-sql_set__var.cc       2 Aug 2011 16:15:08 -0000       1.1
+++ patches/patch-sql_set__var.cc       4 Aug 2011 06:30:19 -0000
@@ -4,15 +4,16 @@
 
 --- sql/set_var.cc.orig        2011-01-25 11:27:51.000000000 +0000
 +++ sql/set_var.cc
-@@ -2717,7 +2717,10 @@ bool sys_var_timestamp::check(THD *thd, 
+@@ -2717,7 +2717,11 @@ bool sys_var_timestamp::check(THD *thd, 
    time_t val;
    var->save_result.ulonglong_value= var->value->val_int();
    val= (time_t) var->save_result.ulonglong_value;
 -  if (val < (time_t) MY_TIME_T_MIN || val > (time_t) MY_TIME_T_MAX)
 +  if ((val < TIMESTAMP_MIN_VALUE)
 +#if SIZEOF_TIME_T > 4
-+      || (val > TIMESTAMP_MAX_VALUE))
-+#endif)
++      || (val > TIMESTAMP_MAX_VALUE)
++#endif
++                                      )
    {
      my_message(ER_UNKNOWN_ERROR, 
                 "This version of MySQL doesn't support dates later than 2038",


begin 644 mysql5-server-patch-patch
M26YD97@Z(&1I<W1I;F9O"CT]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T*4D-3(&9I
M;&4Z("]C=G-R;V]T+TYE=$)31"]P:V=S<F,O9&%T86)A<V5S+VUY<W%L-2US
M97)V97(O9&ES=&EN9F\L=@IR971R:65V:6YG(')E=FES:6]N(#$N,C<*9&EF
M9B`M=2`M<C$N,C<@9&ES=&EN9F\*+2TM(&1I<W1I;F9O"3(@075G(#(P,3$@
M,38Z,34Z,#@@+3`P,#`),2XR-PHK*RL@9&ES=&EN9F\)-"!!=6<@,C`Q,2`P
M-CHS,#HR."`M,#`P,`I`0"`M,C0L-R`K,C0L-R!`0`H@4TA!,2`H<&%T8V@M
M:6YC;'5D95]M>5]?=&EM92YH*2`](#,V.69B-#8X,S@X8F1E8S1E.#0T.3DR
M-V4R,3`Y83@X,SEF9&1E.&$*(%-(03$@*'!A=&-H+6UY<W%L+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T
M:&0L(`H@("`@=&EM95]T('9A;#L*("`@('9A<BT^<V%V95]R97-U;'0N=6QO
M;F=L;VYG7W9A;'5E/2!V87(M/G9A;'5E+3YV86Q?:6YT*"D["B`@("!V86P]
M("AT:6UE7W0I('9A<BT^<V%V95]R97-U;'0N=6QO;F=L;VYG7W9A;'5E.PH@
M+2`@:68@*'9A;"`\("AT:6UE7W0I($U97U1)345?5%]-24X@?'P@=F%L(#X@
M*'1I;65?="D@35E?5$E-15]47TU!6"D*("L@(&EF("@H=F%L(#P@5$E-15-4
M04U07TU)3E]604Q512D*("LC:68@4TE:14]&7U1)345?5"`^(#0*+2L@("`@
M("!\?"`H=F%L(#X@5$E-15-404U07TU!6%]604Q512DI"BTK(V5N9&EF*0HK
M*R`@("`@('Q\("AV86P@/B!424U%4U1!35!?34%87U9!3%5%*0HK*R-E;F1I
M9@HK*PD)"0D)*0H@("`@>PH@("`@("!M>5]M97-S86=E*$527U5.2TY/5TY?
M15)23U(L(`H@("`@("`@("`@("`@("`@(")4:&ES('9E<G-I;VX@;V8@37E3
K44P@9&]E<VXG="!S=7!P;W)T(&1A=&5S(&QA=&5R('1H86X@,C`S."(L"GE3
`
end



Home | Main Index | Thread Index | Old Index