Your message dated Sat, 09 Sep 2006 14:33:22 -0700 with message-id <[EMAIL PROTECTED]> and subject line Bug#381808: fixed in libdbi-ruby 0.0.23-4 has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what I am talking about this indicates a serious mail system misconfiguration somewhere. Please contact me immediately.) Debian bug tracking system administrator (administrator, Debian Bugs database)
--- Begin Message ---Package: libdbi-ruby1.8 Version: 0.0.23-2+3.2.5 Severity: normal Tags: patch Hello, Consider the following test: #!/usr/bin/ruby require 'dbi' second_transaction = $*.first && $*.first == '1' ? true : false @db = DBI.connect 'DBI:Pg:test' @db['AutoCommit'] = false if @db.select_all("SELECT tablename FROM pg_tables " \ "WHERE schemaname = 'public' AND tablename = 'test'").size == 1 @db.do 'DROP TABLE public.test' end @db.do <<EOF CREATE TABLE public.test ( id INTEGER NOT NULL ); EOF def newId(id) @db.transaction { |db| puts "inserting `#{id}' into public.test" db.do('INSERT INTO public.test VALUES($1)', id) return 42 } end newId(100) exit unless second_transaction puts "executing empty transaction" @db.transaction { |db| } #!/usr/bin/ruby require 'dbi' @db = DBI.connect 'DBI:Pg:test' rows = @db.select_all('SELECT * FROM public.test') puts "#{rows.size} rows in public.test" rows.each { |r| puts "id: #{r.first}" } $./transaction_return && ./check inserting `100' into public.test 0 rows in public.test Without execution of the second transaction, commit isn't done. $./transaction_return 1 && ./check inserting `100' into public.test executing empty transaction 1 rows in public.test id: 100 When the second transaction is executed, INSERT done in the previous transaction is commited. From this it can be concluded that neither commit nor rollback is done when `return' is executed from within a transaction method block. I'm attaching a patch that ensures that commit happens even if control is transferred out of the transaction method. The patch also enhances transaction method to return value returned by block when it could be used in the calling code (i.e. when no exception happened and no return statement executed). -- System Information: Debian Release: testing/unstable APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.4.27-2-k7 Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R) Versions of packages libdbi-ruby1.8 depends on: ii libruby1.8 1.8.2-7sarge2 Libraries necessary to run Ruby 1. libdbi-ruby1.8 recommends no packages. -- no debconf information--- /usr/lib/ruby/1.8/dbi/dbi.rb 2006-04-07 14:11:08.000000000 +1200 +++ dbi.rb 2006-08-04 19:59:02.000000000 +1200 @@ -746,11 +746,16 @@ commit begin - yield self + ret = yield self commit + done = true + ret rescue Exception rollback + done = true raise + ensure + commit unless done end end
--- End Message ---
--- Begin Message ---Source: libdbi-ruby Source-Version: 0.0.23-4 We believe that the bug you reported is fixed in the latest version of libdbi-ruby, which is due to be installed in the Debian FTP archive: libdbd-mysql-ruby1.8_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-mysql-ruby1.8_0.0.23-4_all.deb libdbd-mysql-ruby_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-mysql-ruby_0.0.23-4_all.deb libdbd-odbc-ruby1.8_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-odbc-ruby1.8_0.0.23-4_all.deb libdbd-odbc-ruby_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-odbc-ruby_0.0.23-4_all.deb libdbd-pg-ruby1.8_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-pg-ruby1.8_0.0.23-4_all.deb libdbd-pg-ruby_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-pg-ruby_0.0.23-4_all.deb libdbd-sqlite-ruby1.8_0.0.23-4_i386.deb to pool/main/libd/libdbi-ruby/libdbd-sqlite-ruby1.8_0.0.23-4_i386.deb libdbd-sqlite-ruby_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-sqlite-ruby_0.0.23-4_all.deb libdbd-sqlite3-ruby1.8_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-sqlite3-ruby1.8_0.0.23-4_all.deb libdbd-sqlite3-ruby_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbd-sqlite3-ruby_0.0.23-4_all.deb libdbi-ruby1.8_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbi-ruby1.8_0.0.23-4_all.deb libdbi-ruby_0.0.23-4.diff.gz to pool/main/libd/libdbi-ruby/libdbi-ruby_0.0.23-4.diff.gz libdbi-ruby_0.0.23-4.dsc to pool/main/libd/libdbi-ruby/libdbi-ruby_0.0.23-4.dsc libdbi-ruby_0.0.23-4_all.deb to pool/main/libd/libdbi-ruby/libdbi-ruby_0.0.23-4_all.deb A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to [EMAIL PROTECTED], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Dmitry Borodaenko <[EMAIL PROTECTED]> (supplier of updated libdbi-ruby package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing [EMAIL PROTECTED]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Format: 1.7 Date: Sat, 09 Sep 2006 20:28:16 +0100 Source: libdbi-ruby Binary: libdbi-ruby1.8 libdbd-pg-ruby libdbd-odbc-ruby1.8 libdbd-odbc-ruby libdbd-sqlite-ruby1.8 libdbd-sqlite-ruby libdbd-mysql-ruby libdbd-sqlite3-ruby1.8 libdbi-ruby libdbd-sqlite3-ruby libdbd-pg-ruby1.8 libdbd-mysql-ruby1.8 Architecture: source all i386 Version: 0.0.23-4 Distribution: unstable Urgency: low Maintainer: Dmitry Borodaenko <[EMAIL PROTECTED]> Changed-By: Dmitry Borodaenko <[EMAIL PROTECTED]> Description: libdbd-mysql-ruby - Ruby/DBI driver for MySQL libdbd-mysql-ruby1.8 - Ruby/DBI MySQL driver for Ruby 1.8 libdbd-odbc-ruby - Ruby/DBI driver for ODBC libdbd-odbc-ruby1.8 - Ruby/DBI ODBC driver for Ruby 1.8 libdbd-pg-ruby - Ruby/DBI PostgreSQL driver libdbd-pg-ruby1.8 - Ruby/DBI PostgreSQL driver for Ruby 1.8 libdbd-sqlite-ruby - Ruby/DBI driver for SQLite libdbd-sqlite-ruby1.8 - Ruby/DBI SQLite driver for Ruby 1.8 libdbd-sqlite3-ruby - Ruby/DBI driver for SQLite3 libdbd-sqlite3-ruby1.8 - Ruby/DBI SQLite driver for Ruby 1.8 libdbi-ruby - Database Independent Interface for Ruby libdbi-ruby1.8 - Database Independent Interface for Ruby 1.8 Closes: 381808 Changes: libdbi-ruby (0.0.23-4) unstable; urgency=low . * Transactions fix by Dmitry Maksyoma. Closes: #381808. * Switched inter-module versioned dependencies from ${Source-Version} to ${source:Version} by lintian's advice. * Bumped Standards-Version to 3.7.2. Files: 5d8870a63b24310d6c66eac1948c4baf 847 interpreters optional libdbi-ruby_0.0.23-4.dsc f0236e26e5d3dd8e1f8236cca41dc359 6390 interpreters optional libdbi-ruby_0.0.23-4.diff.gz 205ba105267a93cf36114ea997ff2393 68484 interpreters optional libdbi-ruby_0.0.23-4_all.deb 831f667e908562346d255e73173911c3 29738 interpreters optional libdbi-ruby1.8_0.0.23-4_all.deb 077a2b61726a92353b2343795eed177b 16006 interpreters optional libdbd-pg-ruby_0.0.23-4_all.deb e29687c770a27c89bc3a49bcd542e808 23546 interpreters optional libdbd-pg-ruby1.8_0.0.23-4_all.deb 3da4b0b0a18165cedfc27f31671a7589 16016 interpreters optional libdbd-mysql-ruby_0.0.23-4_all.deb d751db46e54f528619b1a74566a8a808 20246 interpreters optional libdbd-mysql-ruby1.8_0.0.23-4_all.deb 8f9b2e6a7a575dc3ccdf190d282b136f 16010 interpreters optional libdbd-odbc-ruby_0.0.23-4_all.deb 5a9b27b94ea056b215746c555a113def 18388 interpreters optional libdbd-odbc-ruby1.8_0.0.23-4_all.deb 5456e596de6a75753fd47febc8385d35 16012 interpreters optional libdbd-sqlite-ruby_0.0.23-4_all.deb d162c5f9fe8bb67b8e370b47a6e6b1bc 16010 interpreters optional libdbd-sqlite3-ruby_0.0.23-4_all.deb d19434676f13a0a2d7160386a8b6202d 18098 interpreters optional libdbd-sqlite3-ruby1.8_0.0.23-4_all.deb b67aaa2067ada90e597426867673e9a3 24504 interpreters optional libdbd-sqlite-ruby1.8_0.0.23-4_i386.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iEYEARECAAYFAkUDFgkACgkQxhqJXoXuPg4t1gCfcGHB5cqVvpB65Ns+R/Cp47NI jhkAn1RRpyHjVOxLzVUXTw91xqvYaWPK =4AC1 -----END PGP SIGNATURE-----
--- End Message ---

