1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 22:28:47 -04:00

show warnings only when Warn is true

This commit is contained in:
Kenichi Ishigaki 2010-11-14 05:04:15 +00:00
parent 9f291b41d3
commit 5288da34ab

View file

@ -449,7 +449,8 @@ sqlite_db_STORE_attrib(SV *dbh, imp_dbh_t *imp_dbh, SV *keysv, SV *valuesv)
return TRUE; return TRUE;
} }
if (strEQ(key, "unicode")) { if (strEQ(key, "unicode")) {
warn("\"unicode\" attribute will be deprecated. Use \"sqlite_unicode\" instead."); if (DBIc_has(imp_dbh, DBIcf_WARN))
warn("\"unicode\" attribute will be deprecated. Use \"sqlite_unicode\" instead.");
#if PERL_UNICODE_DOES_NOT_WORK_WELL #if PERL_UNICODE_DOES_NOT_WORK_WELL
sqlite_trace(dbh, imp_dbh, 3, form("Unicode support is disabled for this version of perl.")); sqlite_trace(dbh, imp_dbh, 3, form("Unicode support is disabled for this version of perl."));
imp_dbh->unicode = 0; imp_dbh->unicode = 0;
@ -485,7 +486,8 @@ sqlite_db_FETCH_attrib(SV *dbh, imp_dbh_t *imp_dbh, SV *keysv)
#endif #endif
} }
if (strEQ(key, "unicode")) { if (strEQ(key, "unicode")) {
warn("\"unicode\" attribute will be deprecated. Use \"sqlite_unicode\" instead."); if (DBIc_has(imp_dbh, DBIcf_WARN))
warn("\"unicode\" attribute will be deprecated. Use \"sqlite_unicode\" instead.");
#if PERL_UNICODE_DOES_NOT_WORK_WELL #if PERL_UNICODE_DOES_NOT_WORK_WELL
sqlite_trace(dbh, imp_dbh, 3, "Unicode support is disabled for this version of perl."); sqlite_trace(dbh, imp_dbh, 3, "Unicode support is disabled for this version of perl.");
return sv_2mortal(newSViv(0)); return sv_2mortal(newSViv(0));