~clint-fewbar/ubuntu/natty/php5/merge-5.3.3-3

« back to all changes in this revision

Viewing changes to ext/odbc/php_odbc.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-01-26 14:09:58 UTC
  • mfrom: (1.1.16 upstream) (0.3.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100126140958-sos69zwa00q2nt19
Tags: 5.2.12.dfsg.1-2ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/control, debian/rules: Disable a few build dependencies and
    accompanying binary packages which we do not want to support in main:
    + firebird2-dev/php5-interbase (we have a seperate php-interbase source)
    + libc-client/php5-imap (we have a seperate php-imap source)
    + libmcrypt-dev/php5-mcrypt (seperate php-mcrypt source)
    + readline support again, now that the libedit issue is fixed.
  - debian/control: Add build dependency: libedit-dev (>= 2.9.cvs.20050518-1)
    CLI readline support.
  - debian/rules:
    + Correctly mangle PHP5_* macros for lpia
  - debian/control:
    + Rename Vcs-Browser & Vcs-Git to XS-Original-Vcs-Browser & XS-Original-Vcs-Git (LP: #323731).
  - debian/control: Move php5-suhoshin to Suggests.
  - debian/rules: Fix broken symlink for pear.
  - main/php_version.h: updated with Ubuntu version info
  - debian/patches/series: Re-enable the 033-we_WANT_libtool.patch patch
  - debian/rules, debian/source_php5.py: Install apport hook. 
* Dropped patches: CVE-2009-3557.patch and CVE-2009-3558.patch, no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
   +----------------------------------------------------------------------+
21
21
*/
22
22
 
23
 
/* $Id: php_odbc.c 280532 2009-05-14 17:25:51Z felipe $ */
 
23
/* $Id: php_odbc.c 291772 2009-12-06 18:53:16Z felipe $ */
24
24
 
25
25
#ifdef HAVE_CONFIG_H
26
26
#include "config.h"
725
725
                                                                        NULL, 0, NULL, &displaysize);
726
726
                                displaysize = displaysize <= result->longreadlen ? displaysize : 
727
727
                                                                result->longreadlen;
 
728
                                /* Workaround for Oracle ODBC Driver bug (#50162) when fetching TIMESTAMP column */
 
729
                                if (result->values[i].coltype == SQL_TIMESTAMP) {
 
730
                                        displaysize += 3;
 
731
                                }
728
732
                                result->values[i].value = (char *)emalloc(displaysize + 1);
729
733
                                rc = SQLBindCol(result->stmt, (SQLUSMALLINT)(i+1), SQL_C_CHAR, result->values[i].value,
730
734
                                                        displaysize + 1, &result->values[i].vallen);
925
929
                        /* Try to set CURSOR_TYPE to dynamic. Driver will replace this with other
926
930
                           type if not possible.
927
931
                        */
928
 
                        int cursortype = ODBCG(default_cursortype);
929
 
                        if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, cursortype) == SQL_ERROR) {
930
 
                                odbc_sql_error(conn, result->stmt, " SQLSetStmtOption");
931
 
                                SQLFreeStmt(result->stmt, SQL_DROP);
932
 
                                efree(result);
933
 
                                RETURN_FALSE;
934
 
                        }
 
932
                        SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype));
935
933
                }
936
934
        } else {
937
935
                result->fetch_abs = 0;
1346
1344
                        /* Try to set CURSOR_TYPE to dynamic. Driver will replace this with other
1347
1345
                           type if not possible.
1348
1346
                         */
1349
 
                        int cursortype = ODBCG(default_cursortype);
1350
 
                        if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, cursortype) == SQL_ERROR) {
1351
 
                                odbc_sql_error(conn, result->stmt, " SQLSetStmtOption");
1352
 
                                SQLFreeStmt(result->stmt, SQL_DROP);
1353
 
                                efree(result);
1354
 
                                RETURN_FALSE;
1355
 
                        }
 
1347
                        SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, ODBCG(default_cursortype));
1356
1348
                }
1357
1349
        } else {
1358
1350
                result->fetch_abs = 0;