rtutil: Avoid loading from a URI in RTLinkCache.setup.
See comments for rationale. RT#10543.
This commit is contained in:
		
							parent
							
								
									66cd27e7f0
								
							
						
					
					
						commit
						c1ecc48297
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -116,8 +116,13 @@ class RTLinkCache(_LinkCache):
 | 
			
		|||
                db.close()
 | 
			
		||||
                db = sqlite3.connect(':memory:', isolation_level=None)
 | 
			
		||||
                cursor = db.cursor()
 | 
			
		||||
                # It would better to use
 | 
			
		||||
                #   '{}?mode=ro'.format(cache_path.as_uri())
 | 
			
		||||
                # as the argument here, but that doesn't work on SUSE 15,
 | 
			
		||||
                # possibly because its sqlite doesn't recognize query
 | 
			
		||||
                # arguments (added to upstream sqlite in late 2016).
 | 
			
		||||
                cursor.execute('ATTACH DATABASE ? AS readsource',
 | 
			
		||||
                               ('{}?mode=ro'.format(cache_path.as_uri()),))
 | 
			
		||||
                               (os.fspath(cache_path),))
 | 
			
		||||
                cursor.execute(cls.CREATE_TABLE_SQL)
 | 
			
		||||
                cursor.execute('INSERT INTO RTLinkCache SELECT * FROM readsource.RTLinkCache')
 | 
			
		||||
                cursor.execute('DETACH DATABASE readsource')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue