Issue Details (XML | Word | Printable)

Key: MDL-15671
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Andrei Bautu
Votes: 0
Watchers: 2
Operations

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

Add reset_sequence to db layer

Created: 16/Jul/08 05:02 PM   Updated: 25/Aug/08 09:00 PM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 2.0
Fix Version/s: 2.0

File Attachments: 1. Text File 200807311107-MDL-15671.patch (7 kB)


Participants: Andrei Bautu and Petr Skoda
Security Level: None
Resolved date: 25/Aug/08
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Andrei Bautu added a comment - 20/Jul/08 07:17 AM - edited
I still believe that sequence reset belongs to ddl. Yes, it uses some data (max(id)) which will be retrieved by dml, but the workhorse should be in ddl (with a generic bootstrap method in dml).
Instead of copy/pasting the same code for each driver type, this approach would allow statements to be reuse per db type. For example, like in the case of CREATE SEQUENCE, CREATE TABLE, etc, ALTER TABLE xyz AUTO_INCREMENT value it's the same for MySQL no matter what driver type you use (adodb, pdo, native).

Andrei Bautu made changes - 20/Jul/08 07:17 AM
Field Original Value New Value
Attachment 200807200206-MDL-15671.patch [ 14592 ]
Andrei Bautu made changes - 31/Jul/08 04:08 PM
Attachment 200807311107-MDL-15671.patch [ 14722 ]
Andrei Bautu made changes - 31/Jul/08 04:08 PM
Attachment 200807200206-MDL-15671.patch [ 14592 ]
Petr Skoda made changes - 25/Aug/08 08:52 PM
Assignee Eloy Lafuente (stronk7) [ stronk7 ] Petr Skoda [ skodak ]
Petr Skoda committed 6 files to 'Moodle CVS' - 25/Aug/08 08:52 PM
MDL-15671 support for table sequence resetting - code by Andrei Bautu (with minor modifications)
MODIFY lib/dml/Attic/mssql_adodb_moodle_database.php   Rev. 1.19    (+18 -1 lines)
MODIFY lib/dml/moodle_database.php   Rev. 1.44    (+9 -2 lines)
MODIFY lib/dml/Attic/oci8po_adodb_moodle_database.php   Rev. 1.20    (+28 -1 lines)
MODIFY lib/dml/Attic/postgres7_adodb_moodle_database.php   Rev. 1.16    (+17 -2 lines)
MODIFY lib/dml/sqlite3_pdo_moodle_database.php   Rev. 1.4    (+15 -1 lines)
MODIFY lib/dml/Attic/mysqli_adodb_moodle_database.php   Rev. 1.10    (+17 -2 lines)
Petr Skoda added a comment - 25/Aug/08 09:00 PM
code committed into cvs, minor changes related to table_exists() and return values added.

thanks!


Petr Skoda made changes - 25/Aug/08 09:00 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.0 [ 10122 ]
Petr Skoda committed 8 files to 'Moodle CVS' - 26/Aug/08 05:00 AM
MDL-15671, MDL-15717 DB->import_record() support - code based on patch by Andrei Bautu; added new param to raw insert; unit tests included
MODIFY lib/dml/moodle_database.php   Rev. 1.45    (+13 -2 lines)
MODIFY lib/dml/Attic/postgres7_adodb_moodle_database.php   Rev. 1.17    (+73 -14 lines)
MODIFY lib/dml/Attic/adodb_moodle_database.php   Rev. 1.20    (+12 -3 lines)
MODIFY lib/dml/Attic/mssql_adodb_moodle_database.php   Rev. 1.20    (+55 -1 lines)
MODIFY lib/dml/pdo_moodle_database.php   Rev. 1.9    (+45 -14 lines)
MODIFY lib/dml/simpletest/testdml.php   Rev. 1.14    (+52 -3 lines)
MODIFY lib/dml/Attic/oci8po_adodb_moodle_database.php   Rev. 1.21    (+79 -3 lines)
MODIFY lib/dml/Attic/mysqli_adodb_moodle_database.php   Rev. 1.11    (+28 -1 lines)