1
0

tkt-26ff0c2d1e.test 977 B

123456789101112131415161718192021222324252627282930313233
  1. # 2010 May 12
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  6. # May you do good and not evil.
  7. # May you find forgiveness for yourself and forgive others.
  8. # May you share freely, never taking more than you give.
  9. #
  10. #***********************************************************************
  11. # This file implements regression tests for SQLite library. The
  12. # focus of this script testing a bug found in the OP_Variable optimizer
  13. #
  14. set testdir [file dirname $argv0]
  15. source $testdir/tester.tcl
  16. do_test bug-20100512-1 {
  17. set DB [sqlite3_connection_pointer db]
  18. set SQL {SELECT case when 1 then 99 else ? end + ?}
  19. set STMT [sqlite3_prepare_v2 $DB $SQL -1 TAIL]
  20. set TAIL
  21. } {}
  22. do_test bug-20100512-2 {
  23. sqlite3_bind_parameter_count $STMT
  24. } 2
  25. do_test bug-20100512-3 {
  26. sqlite3_bind_int $STMT 1 123
  27. sqlite3_bind_int $STMT 2 456
  28. sqlite3_step $STMT
  29. sqlite3_column_int $STMT 0
  30. } {555}
  31. sqlite3_finalize $STMT