mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	- Added version checks in C code to make sure we don't trigger bugs in older
SQLite versions. - Added version checks in test suite so that we don't execute tests that we know will fail with older (buggy) SQLite versions. Now, all tests should run against all SQLite versions from 3.0.8 until 3.3.6 (latest one now). The sqlite3 module can be built against all these SQLite versions and the sqlite3 module does its best to not trigger bugs in SQLite, but using SQLite 3.3.3 or later is recommended.
This commit is contained in:
		
							parent
							
								
									69f6168b76
								
							
						
					
					
						commit
						b2e8816403
					
				
					 3 changed files with 27 additions and 4 deletions
				
			
		|  | @ -200,6 +200,8 @@ def CheckFuncReturnBlob(self): | |||
|         self.failUnlessEqual(val, buffer("blob")) | ||||
| 
 | ||||
|     def CheckFuncException(self): | ||||
|         if sqlite.version_info < (3, 3, 3):     # don't raise bug in earlier SQLite versions | ||||
|             return | ||||
|         cur = self.con.cursor() | ||||
|         try: | ||||
|             cur.execute("select raiseexception()") | ||||
|  | @ -283,6 +285,8 @@ def CheckAggrNoStep(self): | |||
|             self.failUnlessEqual(e.args[0], "AggrNoStep instance has no attribute 'step'") | ||||
| 
 | ||||
|     def CheckAggrNoFinalize(self): | ||||
|         if sqlite.version_info < (3, 3, 3):     # don't raise bug in earlier SQLite versions | ||||
|             return | ||||
|         cur = self.con.cursor() | ||||
|         try: | ||||
|             cur.execute("select nofinalize(t) from test") | ||||
|  | @ -292,6 +296,8 @@ def CheckAggrNoFinalize(self): | |||
|             self.failUnlessEqual(e.args[0], "user-defined aggregate's 'finalize' method raised error") | ||||
| 
 | ||||
|     def CheckAggrExceptionInInit(self): | ||||
|         if sqlite.version_info < (3, 3, 3):     # don't raise bug in earlier SQLite versions | ||||
|             return | ||||
|         cur = self.con.cursor() | ||||
|         try: | ||||
|             cur.execute("select excInit(t) from test") | ||||
|  | @ -301,6 +307,8 @@ def CheckAggrExceptionInInit(self): | |||
|             self.failUnlessEqual(e.args[0], "user-defined aggregate's '__init__' method raised error") | ||||
| 
 | ||||
|     def CheckAggrExceptionInStep(self): | ||||
|         if sqlite.version_info < (3, 3, 3):     # don't raise bug in earlier SQLite versions | ||||
|             return | ||||
|         cur = self.con.cursor() | ||||
|         try: | ||||
|             cur.execute("select excStep(t) from test") | ||||
|  | @ -310,6 +318,8 @@ def CheckAggrExceptionInStep(self): | |||
|             self.failUnlessEqual(e.args[0], "user-defined aggregate's 'step' method raised error") | ||||
| 
 | ||||
|     def CheckAggrExceptionInFinalize(self): | ||||
|         if sqlite.version_info < (3, 3, 3):     # don't raise bug in earlier SQLite versions | ||||
|             return | ||||
|         cur = self.con.cursor() | ||||
|         try: | ||||
|             cur.execute("select excFinalize(t) from test") | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Gerhard Häring
						Gerhard Häring