diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-05-18 09:39:31 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-05-18 09:39:31 -0400 |
commit | 808c9c74a72b95e6272c8927cce839d89626ba47 (patch) | |
tree | 8047b7cee667ca0c2b6b9bb12a4c3e33a34704fa /lib/sisu/v6/db_remove.rb | |
parent | debian/changelog (5.3.5-1) (diff) | |
parent | v5 v6: cgi, sample search forms: use ruby-pg & ruby-sqlite3; remove ruby-dbi (diff) |
Merge tag 'sisu_5.3.6' into debian/sid
SiSU 5.3.6
Diffstat (limited to 'lib/sisu/v6/db_remove.rb')
-rw-r--r-- | lib/sisu/v6/db_remove.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/sisu/v6/db_remove.rb b/lib/sisu/v6/db_remove.rb index 650c84a2..b1628030 100644 --- a/lib/sisu/v6/db_remove.rb +++ b/lib/sisu/v6/db_remove.rb @@ -70,7 +70,7 @@ module SiSU_DbRemove @db=SiSU_Env::InfoDb.new end def remove - driver_sqlite3=if @sql_type=='sqlite' + driver_sqlite3=if @sql_type==:sqlite (@conn.inspect.match(/^(.{10})/)[1]==@db.sqlite.conn_sqlite3.inspect.match(/^(.{10})/)[1]) \ ? true : false @@ -90,8 +90,8 @@ module SiSU_DbRemove WHERE metadata_and_text.src_filename = '#{@md.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' ;} # note, for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns - x=@conn.select_one(remove_selected) - x ? (x.join.to_i) : nil + x=@conn.exec(remove_selected) + x.field_values("tid")[0] end if del_id sql_entry=[ @@ -105,12 +105,20 @@ module SiSU_DbRemove if driver_sqlite3 @conn.transaction sql_entry.each do |s| - @conn.execute(s) + begin + @conn.execute(s) + rescue + next + end end @conn.commit if driver_sqlite3 else sql_entry.each do |s| - @conn.execute(s) + begin + @conn.exec_params(s) + rescue + next + end end end if @opt.act[:maintenance][:set]==:on |