mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-08 14:48:32 -04:00
DBD-SQLite: added error handling
This commit is contained in:
parent
7341f396bc
commit
38451d9dc1
1 changed files with 5 additions and 1 deletions
6
dbdimp.c
6
dbdimp.c
|
@ -801,7 +801,11 @@ sqlite_st_FETCH_attrib (SV *sth, imp_sth_t *imp_sth, SV *keysv)
|
|||
const char *fieldname = sqlite3_column_name(imp_sth->stmt, n);
|
||||
const char *datatype, *collseq;
|
||||
int notnull, primary, autoinc;
|
||||
sqlite3_table_column_metadata(imp_dbh->db, database, tablename, fieldname, &datatype, &collseq, ¬null, &primary, &autoinc);
|
||||
int retval = sqlite3_table_column_metadata(imp_dbh->db, database, tablename, fieldname, &datatype, &collseq, ¬null, &primary, &autoinc);
|
||||
if (retval != SQLITE_OK) {
|
||||
char *errmsg = (char*)sqlite3_errmsg(imp_dbh->db);
|
||||
sqlite_error(sth, (imp_xxh_t*)imp_sth, retval, errmsg);
|
||||
}
|
||||
av_store(av, n, newSViv(!notnull));
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue