From b78c888711d4079a350be7e4bd0f1a7fcacfc6bc Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Wed, 6 May 2009 10:19:29 +0000 Subject: [PATCH] DBD-SQLite: fixed return value of create_aggregate --- SQLite.xs | 6 ++++-- dbdimp.c | 4 +++- dbdimp.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SQLite.xs b/SQLite.xs index 3528238..9cd9d95 100644 --- a/SQLite.xs +++ b/SQLite.xs @@ -60,7 +60,7 @@ enable_load_extension(dbh, onoff) OUTPUT: RETVAL -void +static int create_aggregate(dbh, name, argc, aggr) SV *dbh char *name @@ -70,8 +70,10 @@ create_aggregate(dbh, name, argc, aggr) DBD::SQLite::db::sqlite_create_aggregate = 1 CODE: { - sqlite3_db_create_aggregate(aTHX_ dbh, name, argc, aggr ); + RETVAL = sqlite3_db_create_aggregate(aTHX_ dbh, name, argc, aggr ); } + OUTPUT: + RETVAL static int create_collation(dbh, name, func) diff --git a/dbdimp.c b/dbdimp.c index 274ba23..9c4524f 100644 --- a/dbdimp.c +++ b/dbdimp.c @@ -1164,7 +1164,7 @@ sqlite_db_aggr_finalize_dispatcher( sqlite3_context *context ) LEAVE; } -void +int sqlite3_db_create_aggregate(pTHX_ SV *dbh, const char *name, int argc, SV *aggr_pkg ) { D_imp_dbh(dbh); @@ -1185,7 +1185,9 @@ sqlite3_db_create_aggregate(pTHX_ SV *dbh, const char *name, int argc, SV *aggr_ { char* const errmsg = form("sqlite_create_aggregate failed with error %s", sqlite3_errmsg(imp_dbh->db)); sqlite_error(dbh, (imp_xxh_t*)imp_dbh, retval, errmsg); + return FALSE; } + return TRUE; } diff --git a/dbdimp.h b/dbdimp.h index 4c435ce..52791f7 100644 --- a/dbdimp.h +++ b/dbdimp.h @@ -80,7 +80,7 @@ struct aggrInfo { int sqlite3_db_create_function(pTHX_ SV *dbh, const char *name, int argc, SV *func); int sqlite3_db_enable_load_extension(pTHX_ SV *dbh, int onoff); -void sqlite3_db_create_aggregate(pTHX_ SV *dbh, const char *name, int argc, SV *aggr ); +int sqlite3_db_create_aggregate(pTHX_ SV *dbh, const char *name, int argc, SV *aggr ); int sqlite3_db_create_collation(pTHX_ SV *dbh, const char *name, SV *func); int sqlite3_db_progress_handler(pTHX_ SV *dbh, int n_opcodes, SV *handler); void sqlite_st_reset(pTHX_ SV *sth );