Issue Details (XML | Word | Printable)

Key: MDL-15071
Type: Task Task
Status: Open Open
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Andrei Bautu
Votes: 0
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

SQLite support

Created: 31/May/08 07:36 PM   Updated: 31/Jul/08 05:05 PM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 2.0
Fix Version/s: None

File Attachments: 1. Text File 200806221743-sqlite_acceslib.patch (1 kB)
2. Text File 200806221743-sqlite_dml_ddl.patch (52 kB)
3. Text File 200806221743-sqlite_install.patch (5 kB)
4. Text File 200806301845-lib.patch (5 kB)
5. Text File 200807081047-xmldb.patch (2 kB)
6. Text File 200807081058-moodle.patch (31 kB)
7. Text File 200807090136-sql_generator.php.patch (2 kB)
8. Text File 20080713_db_move_patch_merged3.patch (26 kB)
9. Text File 200807311303-MDL-15071.patch (16 kB)

Issue Links:
Relates
 

URL: http://docs.moodle.org/en/Student_projects/SQLite
Participants: Andrei Bautu, Eloy Lafuente (stronk7) and Petr Skoda
Security Level: None
Affected Branches: MOODLE_20_STABLE


 Description  « Hide
This project is part of the 2008 edition of Google Summer of Code (GSoC). Mentor: Penny Leach. Student: Andrei Bautu.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Andrei Bautu made changes - 20/Jun/08 01:44 PM
Field Original Value New Value
Attachment sqlite_sql_generator.php [ 14288 ]
Andrei Bautu made changes - 20/Jun/08 01:44 PM
Attachment sqlite3_pdo_moodle_database.php [ 14289 ]
Petr Skoda added a comment - 20/Jun/08 03:12 PM
please do not use tab characters

Andrei Bautu made changes - 22/Jun/08 11:21 PM
Attachment sqlite3_pdo_moodle_database.php [ 14289 ]
Andrei Bautu made changes - 22/Jun/08 11:21 PM
Attachment sqlite_sql_generator.php [ 14288 ]
Andrei Bautu added a comment - 22/Jun/08 11:21 PM
SQL update rewrite

Andrei Bautu made changes - 22/Jun/08 11:21 PM
Attachment 200806221743-sqlite_acceslib.patch [ 14302 ]
Andrei Bautu added a comment - 22/Jun/08 11:22 PM
SQLite language strings and install options

Andrei Bautu made changes - 22/Jun/08 11:22 PM
Attachment 200806221743-sqlite_install.patch [ 14303 ]
Andrei Bautu added a comment - 22/Jun/08 11:25 PM
  • rewrite of connect in moodle_database (and use it in subclasses) - (some part of it was submitted in http://tracker.moodle.org/secure/attachment/14293/200806202038-dml.patch so it deprecates that patch)
  • generic implementation of pdo_moodle_database and pdo_moodle_recordset
  • implementation of sqlite_sql_generator
  • implementation of sqlite3_pdo_moodle_database

Andrei Bautu made changes - 22/Jun/08 11:25 PM
Attachment 200806221743-sqlite_dml_ddl.patch [ 14304 ]
Petr Skoda made changes - 23/Jun/08 12:10 AM
Assignee Eloy Lafuente (stronk7) [ stronk7 ] Petr Skoda [ skodak ]
Petr Skoda committed 1 file to 'Moodle CVS' - 23/Jun/08 04:42 AM
MDL-15071 sqlite compatibility fix - by Andrei Bautu
MODIFY lib/accesslib.php   Rev. 1.503    (+10 -2 lines)
Petr Skoda committed 8 files to 'Moodle CVS' - 23/Jun/08 05:35 AM
MDL-15071 new sqlite pdo driver by Andrei Bautu (with minor changes)
MODIFY admin/environment.xml   Rev. 1.32    (+1 -0 lines)
MODIFY lib/dml/pdo_moodle_recordset.php   Rev. 1.5    (+20 -7 lines)
MODIFY lang/en_utf8/install.php   Rev. 1.24    (+10 -1 lines)
ADD lib/dml/sqlite3_pdo_moodle_database.php   Rev. 1.1    (+0 -0 lines)
MODIFY install/stringnames.txt   Rev. 1.13    (+3 -0 lines)
MODIFY lib/dml/pdo_moodle_database.php   Rev. 1.5    (+482 -58 lines)
ADD lib/ddl/sqlite_sql_generator.php   Rev. 1.1    (+0 -0 lines)
MODIFY install.php   Rev. 1.104    (+11 -3 lines)
Petr Skoda added a comment - 23/Jun/08 05:40 AM
patches in cvs:
  • the connect cahnges were not committed - going to rewrite this part
  • install/lang/ can not be edited directly
  • I had some problems with the ddl_dml patch, the relative paths there totally confused my eclipse

thanks for the patches!

Now I am going to:
1/ rewrite the connect() and export_dbconfig() methods
2/ remove addsingleslashes() from installer


Petr Skoda committed 1 file to 'Moodle CVS' - 23/Jun/08 06:05 AM
MDL-15071 fixed problem introduced into submitted patch
MODIFY lib/dml/sqlite3_pdo_moodle_database.php   Rev. 1.2    (+2 -2 lines)
Petr Skoda committed 1 file to 'Moodle CVS' - 23/Jun/08 06:32 AM
MDL-15071 fixed typo
MODIFY lib/dml/pdo_moodle_database.php   Rev. 1.6    (+2 -2 lines)
Petr Skoda added a comment - 23/Jun/08 06:54 AM
my changes are in cvs, please cvs update

Eloy Lafuente (stronk7) added a comment - 23/Jun/08 07:54 AM
Have seen one commit related to this bug:

+ } else {
+ // sqlite and others
+ $updatesql = "UPDATE {context}
+ SET path = (SELECT path FROM {context_temp} WHERE id = {context}.id),
+ depth = (SELECT depth FROM {context_temp} WHERE id = {context}.id)
+ WHERE id IN (SELECT id FROM mdl_context_temp)";

I'd suggest using EXISTS instead of IN. Not sure if sqllite supports it, though.

FYC, ciao, Eloy


Mitsuhiro Yoshida committed 1 file to 'Lang CVS' - 23/Jun/08 09:08 AM
Translated new strings for sqlite pdo driver MDL-15071.
MODIFY ja_utf8/install.php   Rev. 1.38    (+10 -2 lines)
Andrei Bautu added a comment - 23/Jun/08 01:18 PM
@Eloy SQLite supports IN, but is there a particular reason for using EXISTS instead of IN?
In this case, the subquery would reference the record in the {context} table like this (SELECT id FROM {context_temp} WHERE id = {context}.id). For many RDBMS this means to rerun the subquery for each record. Using IN involves running the subquery only once and then check the result for each record.

martignoni committed 1 file to 'Lang CVS' - 25/Jun/08 05:10 PM
MDL-15071, strings for new sqlite pdo driver
MODIFY fr_utf8/install.php   Rev. 1.29    (+12 -3 lines)
Andrei Bautu made changes - 30/Jun/08 11:47 PM
Attachment 200806301845-lib.patch [ 14380 ]
Andrei Bautu added a comment - 08/Jul/08 04:04 PM
Fixes a regular expression in xmldb_object which breaks sentences with empty strings.

Andrei Bautu made changes - 08/Jul/08 04:04 PM
Attachment 200807081047-xmldb.patch [ 14481 ]
Andrei Bautu added a comment - 08/Jul/08 04:13 PM
  • list all supported drivers (from install.php) is returned by static method moodle_database::get_supported_drivers
  • static method moodle_database::get_driver() loads the class and returns a specific driver
  • static method moodle_database::get_all_drivers() loads the classes and returns objects for each supported driver
  • method moodle_database::export_dbconfig now exports cached settings (which can be set with store_settings or connect)
  • method database_manager::get_generator returns the generator
  • method database_manager::install_from_xmldb_structure installs a database from a xmldb_structure
  • method database_manager::install_from_xmldb_file load the file and calls install_from_xmldb_structure
  • fixes of the SQLite layer
  • new Database mover tool which can switch, transfer, import and export Moodle databases and update config.php file

Andrei Bautu made changes - 08/Jul/08 04:13 PM
Attachment 200807081058-moodle.patch [ 14482 ]
Petr Skoda added a comment - 08/Jul/08 04:46 PM
thanks!! going to start merging this at the end of this week, we have to release 1.9.2 and friends now.

Andrei Bautu added a comment - 09/Jul/08 06:41 AM
rewrite of getAllReservedWords and added support for SQLite's reserved words

Andrei Bautu made changes - 09/Jul/08 06:41 AM
Petr Skoda committed 2 files to 'Moodle CVS' - 13/Jul/08 06:12 PM
MDL-15071 fixes of the SQLite layer by Andrei Bautu
MODIFY lib/dml/sqlite3_pdo_moodle_database.php   Rev. 1.3    (+12 -5 lines)
MODIFY lib/ddl/sqlite_sql_generator.php   Rev. 1.2    (+2 -2 lines)
Petr Skoda committed 1 file to 'Moodle CVS' - 13/Jul/08 06:14 PM
MDL-15071 coding style improvement by Index: sql_generator.php by Andrei Bautu
MODIFY lib/ddl/sql_generator.php   Rev. 1.12    (+8 -28 lines)
Petr Skoda committed 2 files to 'Moodle CVS' - 13/Jul/08 06:52 PM
MDL-15071 Fixes a regular expression in xmldb_object which breaks sentences with empty strings, it is possible to specify record id in statement (needed for database moving) - by Andrei Bautu
MODIFY lib/xmldb/xmldb_statement.php   Rev. 1.3    (+3 -1 lines)
MODIFY lib/xmldb/xmldb_object.php   Rev. 1.2    (+2 -2 lines)
Petr Skoda added a comment - 13/Jul/08 07:07 PM
sending db move patch updated to apply to current HEAD (not tested)

Petr Skoda made changes - 13/Jul/08 07:07 PM
Attachment db_move_patch_merged.patch [ 14533 ]
Petr Skoda made changes - 13/Jul/08 07:21 PM
Attachment db_move_patch_merged.patch [ 14533 ]
Petr Skoda added a comment - 13/Jul/08 07:21 PM
oops, forgot to include some parts, moment please

Petr Skoda made changes - 13/Jul/08 07:33 PM
Attachment 20080713_db_move_patch_merged2.patch [ 14534 ]
Petr Skoda committed 1 file to 'Moodle CVS' - 13/Jul/08 07:42 PM
MDL-15071 undoing part of previous commit, let's wait for Eloy
MODIFY lib/xmldb/xmldb_statement.php   Rev. 1.4    (+1 -3 lines)
Petr Skoda made changes - 13/Jul/08 07:43 PM
Petr Skoda made changes - 13/Jul/08 07:43 PM
Attachment 20080713_db_move_patch_merged2.patch [ 14534 ]
Petr Skoda added a comment - 13/Jul/08 09:07 PM
going to commit parts that are not related to db migration today and post smaller patch dre - see MDL-15635 for more info

Petr Skoda made changes - 13/Jul/08 09:08 PM
Link This issue has been marked as being related by MDL-15635 [ MDL-15635 ]
Petr Skoda committed 1 file to 'Moodle CVS' - 14/Jul/08 04:27 AM
MDL-15071 new method for installing of table from xmld structure - credit goes to Andrei Bautu
MODIFY lib/ddl/database_manager.php   Rev. 1.12    (+14 -4 lines)
Petr Skoda committed 1 file to 'Moodle CVS' - 14/Jul/08 04:27 AM
MDL-15071 added missing breaks - credit goes to Andrei Bautu
MODIFY lib/dml/database_column_info.php   Rev. 1.4    (+3 -1 lines)
Petr Skoda committed 1 file to 'Moodle CVS' - 14/Jul/08 04:28 AM
MDL-15071 improved error logging - credit goes to Andrei Bautu
MODIFY lib/dml/pdo_moodle_database.php   Rev. 1.8    (+13 -2 lines)
Petr Skoda added a comment - 14/Jul/08 04:29 AM
1/ It seems that we do not need the changes in settings export - not committed
2/ the static methods proposed for moodle_database do not have optimal names imho - get_supported_drivers() returns all core drivers, event those experiment (== not supported), get_all_drivers() does not return "all" drivers, only the core drivers; =& is not needed in PHP5; php docs should be enclosed by /** */ - not committed for now
3/ the database mover changes not committed - see MDL-15635

thanks for the patches!


Andrei Bautu added a comment - 14/Jul/08 05:58 AM
1/ It would be usefull for the db mover if I could get information from a driver (through export) about it's current settings.
2/ I'll fix these comments and =&.
Is get_driver_names better? Or another suggestion, please.
I took the list of drivers from install.php and these are all existing drivers at the moment. What do you mean by "all"?

Andrei Bautu added a comment - 31/Jul/08 05:05 PM
Full ALTER TABLE support + bug fixes

Andrei Bautu made changes - 31/Jul/08 05:05 PM
Attachment 200807311303-MDL-15071.patch [ 14723 ]