August 26, 2012

[MySQL Bug]Bug#13986705 CRASH IN GET_INTERVAL_VALUE() WITH DATE CALCULATION WITH UTF32 INTERVALS

upstream link: http://bazaar.launchpad.net/~mysql/mysql-server/5.5/revision/3840 test case: select space(date_add(101, INTERVAL (CAST(CHAR(‘1’ USING utf16) AS CHAR(1)))hour_second)) 只影响5.5 根据crash的backtrace Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff4643700 (LWP 5874)] 0x0000000000706602 in get_interval_value (args=0x7fff84004e98, int_type=INTERVAL_HOUR_SECOND, str_value=<value optimized out>, interval=0x7ffff4640c40)     at /u01/project/PS5518/trunk/Percona-Server-5.5.18/sql/item_timefunc.cc:1460 1460        while (str != end && my_isspace(cs,*str)) 在my_isspace(cs,*str)这里crash,my_isspace是一个宏: #define my_isspace(s, c)  (((s)->ctype+1)[(uchar) (c)] […]