This commit is contained in:
Pierre Joye 2012-01-31 07:17:05 +00:00
parent 3115e6497a
commit 0e0d79218f

View File

@ -670,14 +670,14 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
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 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
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);