mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-30 05:18:56 +08:00 
			
		
		
		
	Merge pull request #413 from mlfaw/mlfaw-patch-1
Remove version check when bundled
This commit is contained in:
		| @@ -656,8 +656,10 @@ impl Default for OpenFlags { | |||||||
| } | } | ||||||
|  |  | ||||||
| static SQLITE_INIT: Once = ONCE_INIT; | static SQLITE_INIT: Once = ONCE_INIT; | ||||||
|  | #[cfg(not(feature = "bundled"))] | ||||||
| static SQLITE_VERSION_CHECK: Once = ONCE_INIT; | static SQLITE_VERSION_CHECK: Once = ONCE_INIT; | ||||||
| static BYPASS_SQLITE_INIT: AtomicBool = ATOMIC_BOOL_INIT; | static BYPASS_SQLITE_INIT: AtomicBool = ATOMIC_BOOL_INIT; | ||||||
|  | #[cfg(not(feature = "bundled"))] | ||||||
| static BYPASS_VERSION_CHECK: AtomicBool = ATOMIC_BOOL_INIT; | static BYPASS_VERSION_CHECK: AtomicBool = ATOMIC_BOOL_INIT; | ||||||
|  |  | ||||||
| /// rusqlite's check for a safe SQLite threading mode requires SQLite 3.7.0 or | /// rusqlite's check for a safe SQLite threading mode requires SQLite 3.7.0 or | ||||||
| @@ -689,9 +691,11 @@ pub unsafe fn bypass_sqlite_initialization() { | |||||||
| /// calling this function before | /// calling this function before | ||||||
| /// your first connection attempt. | /// your first connection attempt. | ||||||
| pub unsafe fn bypass_sqlite_version_check() { | pub unsafe fn bypass_sqlite_version_check() { | ||||||
|  |     #[cfg(not(feature = "bundled"))] | ||||||
|     BYPASS_VERSION_CHECK.store(true, Ordering::Relaxed); |     BYPASS_VERSION_CHECK.store(true, Ordering::Relaxed); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | #[cfg(not(feature = "bundled"))] | ||||||
| fn ensure_valid_sqlite_version() { | fn ensure_valid_sqlite_version() { | ||||||
|     SQLITE_VERSION_CHECK.call_once(|| { |     SQLITE_VERSION_CHECK.call_once(|| { | ||||||
|         let version_number = version_number(); |         let version_number = version_number(); | ||||||
| @@ -816,6 +820,7 @@ impl InnerConnection { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     fn open_with_flags(c_path: &CString, flags: OpenFlags) -> Result<InnerConnection> { |     fn open_with_flags(c_path: &CString, flags: OpenFlags) -> Result<InnerConnection> { | ||||||
|  |         #[cfg(not(feature = "bundled"))] | ||||||
|         ensure_valid_sqlite_version(); |         ensure_valid_sqlite_version(); | ||||||
|         ensure_safe_sqlite_threading_mode()?; |         ensure_safe_sqlite_threading_mode()?; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user