]> granicus.if.org Git - php/commitdiff
- fix build on HEAD
authorPierre Joye <pajoye@php.net>
Sun, 10 Dec 2006 02:32:17 +0000 (02:32 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 10 Dec 2006 02:32:17 +0000 (02:32 +0000)
  (not sure if it should compile on 6 and 5 or if it is required only for
   pdo, other drivers require this fix)

ext/pdo_sqlite/sqlite_driver.c

index 8eff8a960c1c3263582dfcc3f9a44b14326c7f26..b2fa713b129bd54de5253de492cc5f86aeb4832a 100644 (file)
@@ -78,8 +78,13 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li
        }
 
        if (!dbh->methods) {
+#if PHP_VERSION_ID > 50200
+               zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+                               *pdo_err, einfo->errcode, einfo->errmsg);
+#else
                zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
                                *pdo_err, einfo->errcode, einfo->errmsg);
+#endif
        }
        
        return einfo->errcode;
@@ -737,9 +742,13 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS
        filename = make_filename_safe(dbh->data_source TSRMLS_CC);
 
        if (!filename) {
+#if PHP_VERSION_ID > 50200
+               zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC,
+                       "open_basedir prohibits opening %s", dbh->data_source);
+#else
                zend_throw_exception_ex(php_pdo_get_exception(TSRMLS_C), 0 TSRMLS_CC,
-                       "open_basedir prohibits opening %s",
-                       dbh->data_source);
+                       "open_basedir prohibits opening %s", dbh->data_source);
+#endif
                goto cleanup;
        }