@@ -703,7 +703,7 @@ void bugs::bug66235()
703
703
stmt.reset (con->createStatement ());
704
704
stmt->execute (" DROP TABLE IF EXISTS test" );
705
705
stmt->execute (" CREATE TABLE test(id BIT(3))" );
706
- stmt->execute (" INSERT INTO test(id) VALUES(1 ), (10 ), (1 ), (1 ), (10 ), (111 );" );
706
+ stmt->execute (" INSERT INTO test(id) VALUES(0b1 ), (0b10 ), (0b1 ), (0b1 ), (0b10 ), (0b111 );" );
707
707
708
708
res.reset (stmt->executeQuery (" SELECT MAX(id), MIN(id) FROM test" ));
709
709
while (res->next ())
@@ -733,5 +733,47 @@ void bugs::bug66235()
733
733
}
734
734
735
735
736
+ void bugs::bug14520822 ()
737
+ {
738
+ logMsg (" bug::bug14520822" );
739
+ try
740
+ {
741
+ stmt.reset (con->createStatement ());
742
+ stmt->execute (" DROP TABLE IF EXISTS bug14520822" );
743
+ stmt->execute (" CREATE TABLE bug14520822(b BIT NOT NULL DEFAULT 0)" );
744
+ stmt->execute (" INSERT INTO bug14520822(b) VALUES(0b0), (0b1)" );
745
+
746
+ res.reset (stmt->executeQuery (" select min(b) ,max(b) from bug14520822" ));
747
+ res->next ();
748
+ ASSERT_EQUALS (" 0" , res->getString (1 ));
749
+ ASSERT_EQUALS (" 1" , res->getString (2 ));
750
+ ASSERT_EQUALS (false , res->getBoolean (1 ));
751
+ ASSERT_EQUALS (true , res->getBoolean (2 ));
752
+ ASSERT_EQUALS (0L , res->getInt64 (1 ));
753
+ ASSERT_EQUALS (1L , res->getInt64 (2 ));
754
+
755
+ pstmt.reset (con->prepareStatement (" select min(b) ,max(b) from bug14520822" ));
756
+ res.reset (pstmt->executeQuery ());
757
+ res->next ();
758
+ ASSERT_EQUALS (" 0" , res->getString (1 ));
759
+ ASSERT_EQUALS (" 1" , res->getString (2 ));
760
+ ASSERT_EQUALS (false , res->getBoolean (1 ));
761
+ ASSERT_EQUALS (true , res->getBoolean (2 ));
762
+ ASSERT_EQUALS (0L , res->getInt64 (1 ));
763
+ ASSERT_EQUALS (1L , res->getInt64 (2 ));
764
+
765
+
766
+ }
767
+ catch (sql::SQLException &e)
768
+ {
769
+ logErr (e.what ());
770
+ logErr (" SQLState: " + std::string (e.getSQLState ()));
771
+ fail (e.what (), __FILE__, __LINE__);
772
+ }
773
+
774
+
775
+ }
776
+
777
+
736
778
} /* namespace regression */
737
779
} /* namespace testsuite */
0 commit comments