mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
This commit is contained in:
		
							parent
							
								
									6ffe499397
								
							
						
					
					
						commit
						762fbd3485
					
				
					 4 changed files with 28 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -321,12 +321,13 @@ PyObject* _fetch_one_row(Cursor* self)
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        if (converter != Py_None) {
 | 
			
		||||
            val_str = (const char*)sqlite3_column_text(self->statement->st, i);
 | 
			
		||||
            nbytes = sqlite3_column_bytes(self->statement->st, i);
 | 
			
		||||
            val_str = (const char*)sqlite3_column_blob(self->statement->st, i);
 | 
			
		||||
            if (!val_str) {
 | 
			
		||||
                Py_INCREF(Py_None);
 | 
			
		||||
                converted = Py_None;
 | 
			
		||||
            } else {
 | 
			
		||||
                item = PyString_FromString(val_str);
 | 
			
		||||
                item = PyString_FromStringAndSize(val_str, nbytes);
 | 
			
		||||
                if (!item) {
 | 
			
		||||
                    return NULL;
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue