From: Nirbhay Choubey Date: April 27 2011 12:01pm Subject: bzr push into mysql-5.1 branch (nirbhay.choubey:3673 to 3674) Bug#12329909 List-Archive: http://lists.mysql.com/commits/136198 X-Bug: 12329909 Message-Id: <201104271202.p3RC2EjT018833@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1357928386==" --===============1357928386== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 3674 Nirbhay Choubey 2011-04-27 BUG#12329909 - BUILDING MYSQL WITH DEBUG SUPPORT FAILS WITH LIBEDIT Fixed by checking the return value of the write() function calls and handling the open files and fd appropriately. @ cmd-line-utils/libedit/vi.c BUG#12329909 - BUILDING MYSQL WITH DEBUG SUPPORT FAILS WITH LIBEDIT Added a check on the return value of the write() function calls. modified: cmd-line-utils/libedit/vi.c 3673 Sergey Glukhov 2011-04-27 Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE COMBINATION calc_daynr() function returns negative result if malformed date with zero year and month is used. Attempt to calculate week day on negative value leads to crash. The fix is return NULL for 'W', 'a', 'w' specifiers if zero year and month is used. Additional fix for calc_daynr(): --added assertion that result can not be negative --return 0 if zero year and month is used @ mysql-test/r/func_time.result test case @ mysql-test/t/func_time.test test case @ sql-common/my_time.c --added assertion that result can not be negative --return 0 if zero year and month is used @ sql/item_timefunc.cc eturn NULL for 'W', 'a', 'w' specifiers if zero year and month is used. modified: mysql-test/r/func_time.result mysql-test/t/func_time.test sql-common/my_time.c sql/item_timefunc.cc === modified file 'cmd-line-utils/libedit/vi.c' --- a/cmd-line-utils/libedit/vi.c 2010-10-19 22:36:59 +0000 +++ b/cmd-line-utils/libedit/vi.c 2011-04-27 11:54:10 +0000 @@ -1012,8 +1012,10 @@ vi_histedit(EditLine *el, int c __attrib if (fd < 0) return CC_ERROR; cp = el->el_line.buffer; - write(fd, cp, el->el_line.lastchar - cp +0u); - write(fd, "\n", 1); + if (write(fd, cp, el->el_line.lastchar - cp +0u) == -1) + goto error; + if (write(fd, "\n", 1) == -1) + goto error; pid = fork(); switch (pid) { case -1: @@ -1041,6 +1043,12 @@ vi_histedit(EditLine *el, int c __attrib unlink(tempfile); /* return CC_REFRESH; */ return ed_newline(el, 0); + +/* XXXMYSQL: Avoid compiler warnings. */ +error: + close(fd); + unlink(tempfile); + return CC_ERROR; } /* vi_history_word(): --===============1357928386== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/nirbhay.choubey@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: nirbhay.choubey@stripped\ # vpeshiv6u5snkvzi # target_branch: file:///home/nirbhay/Project/mysql/repo/bugs/mysql-\ # 5.1.12329909/ # testament_sha1: 0f35c4ff8dbde2453dc4da9bce30856ee708b397 # timestamp: 2011-04-27 17:31:55 +0530 # base_revision_id: sergey.glukhov@stripped\ # b7028gag212n8e0y # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRJBihwAAe/fgEU4WH///3/n /uS////wUATBzuBO9Le6bdnd3XMJRCAp5JPZFPNT0aMiZRk2p6mNTQ2QT01DTQ2iDKRkT0myCemS JoNDQGjQAAAAAAkkBNTJlTepP1TxJ5T0n6UYgeUaNDI0AAAA2pTRPVT81SeyHqp7E9Sj09U8U/VD agAGQAAD1AJKKelNptU9NCejInqaeiAAAaAaDQAyBsgQfMN6joMFbwv537THisgLxGS4MQzG9jb3 KgP1vvkD08s9jrl1EQYiVw95L48Z5e4s23VVU/dJ/XSSsJlwOYyaAc30vGHlJHag1B1HYaK/8LCf iJsc5nG++DygcUPDlpawUPEgxijzxRyYfVtMMOIblYJfI0G2lMJV0G9r8/LATRbe4Wc4oXFcxi/R NDsz/vMa6LS5GE7cIzrUigHgmG28I02ZMj7OZ4QSTcndK2nYS4Ewolg5wKNqoUMsFtUlYOcVN55L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