perl-dbi.patch 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. Index: DBD-SQLite-1.13/Makefile.PL
  2. --- DBD-SQLite-1.13/Makefile.PL.orig 2006-09-08 05:45:13 +0200
  3. +++ DBD-SQLite-1.13/Makefile.PL 2006-09-08 17:28:16 +0200
  4. @@ -10,34 +10,6 @@
  5. }
  6. use Config;
  7. use strict;
  8. -eval {
  9. - require DBD::SQLite;
  10. - if ($DBD::SQLite::VERSION < 1.0) {
  11. - print <<EOT;
  12. -
  13. -**** WARNING **** WARNING **** WARNING **** WARNING **** WARNING ****
  14. -
  15. -Your version of DBD::SQLite currently installed ($DBD::SQLite::VERSION) uses
  16. -the old sqlite database format. This version of DBD::SQLite will *NOT*
  17. -open these files, and installing this module may cause problems on your
  18. -system. If this is a live environment you should upgrade with caution.
  19. -
  20. -To upgrade a database, download and install both sqlite 2.x and 3.x from
  21. -http://www.sqlite.org/ and issue:
  22. -
  23. - sqlite OLD.DB .dump | sqlite3 NEW.DB
  24. -
  25. -DBD::SQLite will NOT automatically upgrade a database for you, and using
  26. -this version against an old SQLite database WILL lead to database
  27. -corruption.
  28. -
  29. -EOT
  30. - if (prompt("Continue?", "N") !~ /^y/i) {
  31. - print "Exiting\n";
  32. - exit -1;
  33. - }
  34. - }
  35. -};
  36. # 2005/6/19, by rjray@blackperl.com
  37. #
  38. @@ -120,9 +92,9 @@
  39. 'VERSION_FROM' => 'lib/DBD/SQLite.pm', # finds $VERSION
  40. 'PREREQ_PM' => {DBI => 1.21}, # e.g., Module::Name => 1.1
  41. 'OBJECT' => ($force_local) ? '$(O_FILES)' : 'SQLite.o dbdimp.o',
  42. - 'INC' => '-I. -I$(DBI_INSTARCH_DIR)' .
  43. + 'INC' => '-I@l_prefix@/include -I. -I$(DBI_INSTARCH_DIR)' .
  44. (($sqlite_inc) ? " -I$sqlite_inc" : ''),
  45. - $libs ? ('LIBS' => $libs) : (),
  46. + 'LIBS' => ['-L@l_prefix@/lib -lsqlite3'],
  47. 'OPTIMIZE' => "-O2",
  48. 'DEFINE' => "-DNDEBUG=1 -DSQLITE_PTR_SZ=$Config{ptrsize}" .
  49. ( ($Config{d_usleep} ||
  50. Index: DBD-SQLite-1.13/dbdimp.c
  51. --- DBD-SQLite-1.13/dbdimp.c.orig 2006-09-08 06:50:50 +0200
  52. +++ DBD-SQLite-1.13/dbdimp.c 2006-09-08 17:27:14 +0200
  53. @@ -394,14 +394,17 @@
  54. sqlite_trace(3, "Execute returned %d cols\n", DBIc_NUM_FIELDS(imp_sth));
  55. if (DBIc_NUM_FIELDS(imp_sth) == 0) {
  56. + char *defererr = strdup((char*)sqlite3_errmsg(imp_dbh->db));
  57. while ((retval = sqlite3_step(imp_sth->stmt)) != SQLITE_DONE) {
  58. if (retval == SQLITE_ROW) {
  59. continue;
  60. }
  61. sqlite3_finalize(imp_sth->stmt);
  62. - sqlite_error(sth, (imp_xxh_t*)imp_sth, retval, (char*)sqlite3_errmsg(imp_dbh->db));
  63. + sqlite_error(sth, (imp_xxh_t*)imp_sth, retval, defererr);
  64. + free(defererr);
  65. return -5;
  66. }
  67. + free(defererr);
  68. /* warn("Finalize\n"); */
  69. sqlite3_reset(imp_sth->stmt);
  70. imp_sth->nrow = sqlite3_changes(imp_dbh->db);
  71. Index: DBD-SQLite-1.13/dbdimp.h
  72. --- DBD-SQLite-1.13/dbdimp.h.orig 2006-09-08 06:50:50 +0200
  73. +++ DBD-SQLite-1.13/dbdimp.h 2006-09-08 17:27:14 +0200
  74. @@ -4,7 +4,7 @@
  75. #define _DBDIMP_H 1
  76. #include "SQLiteXS.h"
  77. -#include "sqliteInt.h"
  78. +#include "sqlite3.h"
  79. /* 30 second timeout by default */
  80. #define SQL_TIMEOUT 30000