pajoye                                   Tue, 31 Jan 2012 07:17:05 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=322962

Log:
- fix #55226, WS

Bug: https://bugs.php.net/55226 (Closed) Support creating collations in SQLite
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/pdo_sqlite/sqlite_driver.c
    U   php/php-src/branches/PHP_5_4/ext/pdo_sqlite/sqlite_driver.c
    U   php/php-src/trunk/ext/pdo_sqlite/sqlite_driver.c

Modified: php/php-src/branches/PHP_5_3/ext/pdo_sqlite/sqlite_driver.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/pdo_sqlite/sqlite_driver.c 2012-01-31 
07:14:36 UTC (rev 322961)
+++ php/php-src/branches/PHP_5_3/ext/pdo_sqlite/sqlite_driver.c 2012-01-31 
07:17:05 UTC (rev 322962)
@@ -670,14 +670,14 @@
        struct pdo_sqlite_collation *collation;
        zval *callback;
        char *collation_name;
-       int collation_name_len;
-       char *cbname = NULL;
+       int collation_name_len;
+       char *cbname = NULL;
        pdo_dbh_t *dbh;
        pdo_sqlite_db_handle *H;
        int ret;

        if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz",
-           &collation_name, &collation_name_len, &callback)) {
+               &collation_name, &collation_name_len, &callback)) {
                RETURN_FALSE;
        }

@@ -693,10 +693,10 @@

        H = (pdo_sqlite_db_handle *)dbh->driver_data;

-       collation = (struct pdo_sqlite_collation*)ecalloc(1, 
sizeof(*collation));
+       collation = (struct pdo_sqlite_collation*)ecalloc(1, 
sizeof(*collation));

-       ret = sqlite3_create_collation(H->db, collation_name, SQLITE_UTF8, 
collation, php_sqlite3_collation_callback);
-       if (ret == SQLITE_OK) {
+       ret = sqlite3_create_collation(H->db, collation_name, SQLITE_UTF8, 
collation, php_sqlite3_collation_callback);
+       if (ret == SQLITE_OK) {
                collation->name = estrdup(collation_name);

                MAKE_STD_ZVAL(collation->callback);

Modified: php/php-src/branches/PHP_5_4/ext/pdo_sqlite/sqlite_driver.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/pdo_sqlite/sqlite_driver.c 2012-01-31 
07:14:36 UTC (rev 322961)
+++ php/php-src/branches/PHP_5_4/ext/pdo_sqlite/sqlite_driver.c 2012-01-31 
07:17:05 UTC (rev 322962)
@@ -680,7 +680,7 @@
                &collation_name, &collation_name_len, &callback)) {
                RETURN_FALSE;
        }
-
+
        dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
        PDO_CONSTRUCT_CHECK;

@@ -713,7 +713,6 @@
 }
 /* }}} */

-
 static const zend_function_entry dbh_methods[] = {
        PHP_ME(SQLite, sqliteCreateFunction, NULL, ZEND_ACC_PUBLIC)
        PHP_ME(SQLite, sqliteCreateAggregate, NULL, ZEND_ACC_PUBLIC)

Modified: php/php-src/trunk/ext/pdo_sqlite/sqlite_driver.c
===================================================================
--- php/php-src/trunk/ext/pdo_sqlite/sqlite_driver.c    2012-01-31 07:14:36 UTC 
(rev 322961)
+++ php/php-src/trunk/ext/pdo_sqlite/sqlite_driver.c    2012-01-31 07:17:05 UTC 
(rev 322962)
@@ -680,7 +680,7 @@
                &collation_name, &collation_name_len, &callback)) {
                RETURN_FALSE;
        }
-
+
        dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
        PDO_CONSTRUCT_CHECK;

@@ -713,7 +713,6 @@
 }
 /* }}} */

-
 static const zend_function_entry dbh_methods[] = {
        PHP_ME(SQLite, sqliteCreateFunction, NULL, ZEND_ACC_PUBLIC)
        PHP_ME(SQLite, sqliteCreateAggregate, NULL, ZEND_ACC_PUBLIC)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to