[issue20463] sqlite dumpiter dumps invalid script when virtual tables are used

2018-09-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20463] sqlite dumpiter dumps invalid script when virtual tables are used

2016-10-10 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Attached is patch with a fix for this issue. This is not as comprehensive as 
the solution in apsw but I think this should cover most of the cases. The 
result for Ronny dump after this fix is:

BEGIN TRANSACTION;
PRAGMA writable_schema=ON;
INSERT INTO 
sqlite_master(type,name,tbl_name,rootpage,sql)VALUES('table','test','test',0,'CREATE
 VIRTUAL TABLE test using fts4(example)');
CREATE TABLE 'test_content'(docid INTEGER PRIMARY KEY, 'c0example');
CREATE TABLE 'test_docsize'(docid INTEGER PRIMARY KEY, size BLOB);
CREATE TABLE 'test_segdir'(level INTEGER,idx INTEGER,start_block 
INTEGER,leaves_end_block INTEGER,end_block INTEGER,root BLOB,PRIMARY KEY(level, 
idx));
CREATE TABLE 'test_segments'(blockid INTEGER PRIMARY KEY, block BLOB);
CREATE TABLE 'test_stat'(id INTEGER PRIMARY KEY, value BLOB);
PRAGMA writable_schema=OFF;
COMMIT;

--
keywords: +patch
nosy: +palaviv
Added file: http://bugs.python.org/file45049/20463.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20463] sqlite dumpiter dumps invalid script when virtual tables are used

2015-08-19 Thread Gerhard Häring

Gerhard Häring added the comment:

apsw contains code that handles the issues with dumping SQLite databases very 
well. I plan to integrate this code into pysqlite. We can then later port the 
fix to the sqlite3 module.

See https://github.com/ghaering/pysqlite/issues/10 for the tasks and
https://github.com/rogerbinns/apsw/blob/master/tools/shell.py#L1012 for the 
apsw code.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20463] sqlite dumpiter dumps invalid script when virtual tables are used

2015-01-10 Thread Gerhard Häring

Changes by Gerhard Häring :


--
assignee:  -> ghaering

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20463] sqlite dumpiter dumps invalid script when virtual tables are used

2014-01-31 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20463] sqlite dumpiter dumps invalid script when virtual tables are used

2014-01-31 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +ghaering

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20463] sqlite dumpiter dumps invalid script when virtual tables are used

2014-01-31 Thread Ronny Pfannschmidt

Changes by Ronny Pfannschmidt :


--
components: +Extension Modules
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20463] sqlite dumpiter dumps invalid script when virtual tables are used

2014-01-31 Thread Ronny Pfannschmidt

New submission from Ronny Pfannschmidt:

when using virtual tables, dumpiter generates a broken db script
virtual table entries must be created as master table entries
the sqlite tools dump does that correctly
however pythons iterdump  seems to do that rather different and wrong

sqlite3 test.db "create virtual table test using fts4(example);"
---
sqlite dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
PRAGMA writable_schema=ON;
INSERT INTO 
sqlite_master(type,name,tbl_name,rootpage,sql)VALUES('table','test','test',0,'CREATE
 VIRTUAL TABLE test using fts4(example)');
CREATE TABLE 'test_content'(docid INTEGER PRIMARY KEY, 'c0example');
CREATE TABLE 'test_segments'(blockid INTEGER PRIMARY KEY, block BLOB);
CREATE TABLE 'test_segdir'(level INTEGER,idx INTEGER,start_block 
INTEGER,leaves_end_block INTEGER,end_block INTEGER,root BLOB,PRIMARY KEY(level, 
idx));
CREATE TABLE 'test_docsize'(docid INTEGER PRIMARY KEY, size BLOB);
CREATE TABLE 'test_stat'(id INTEGER PRIMARY KEY, value BLOB);
PRAGMA writable_schema=OFF;
COMMIT;
--
python iterdump "import sqlite3;
c=sqlite3.connect("test.db");
print("\n".join(c.iterdump()))"
BEGIN TRANSACTION;
CREATE VIRTUAL TABLE test using fts4(example);
CREATE TABLE 'test_content'(docid INTEGER PRIMARY KEY, 'c0example');
CREATE TABLE 'test_docsize'(docid INTEGER PRIMARY KEY, size BLOB);
CREATE TABLE 'test_segdir'(level INTEGER,idx INTEGER,start_block 
INTEGER,leaves_end_block INTEGER,end_block INTEGER,root BLOB,PRIMARY KEY(level, 
idx));
CREATE TABLE 'test_segments'(blockid INTEGER PRIMARY KEY, block BLOB);
CREATE TABLE 'test_stat'(id INTEGER PRIMARY KEY, value BLOB);
COMMIT;

--
messages: 209825
nosy: Ronny.Pfannschmidt
priority: normal
severity: normal
status: open
title: sqlite dumpiter dumps invalid script when virtual tables are used
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com