Moodle

Create one XMLDB option to analyse all the INTs within a DB

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.3, 1.8.3, 1.9
  • Fix Version/s: 1.9
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Environment:
    Any MySQL & PostgreSQL server
  • Database:
    MySQL, PostgreSQL
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

changing them to BIGINTs as necessary (when possible).

From Moodle 1.7 all int(10) were changed to bigint(10) for new columns. These leave old sites with a mix of INTs and BIGINTs that should be normalized, to avoid losing any DB thought put performing unnecessary CASTS or SORT merges.

Implement one utility within the XMLDB editor, able to iterate over all the int(10) columns, looking if they are correct BIGINTs or no.

The utility won't perform any action against the DB but provide one SQL script to be executed by hand.

Ciao

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Initial version of the utility is in CVS (HEAD only) now.

It needs some minor changes in postgresql generators (now that we are PG8.0 guys) but should work as in now.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Initial version of the utility is in CVS (HEAD only) now. It needs some minor changes in postgresql generators (now that we are PG8.0 guys) but should work as in now. Ciao
Hide
Petr Škoda (skodak) added a comment -

sending a patch fro install.xml and upgrade; some fields used in foreign keys did have a bad type too - maybe we should check all ints and detect the signed trouble there too.

Show
Petr Škoda (skodak) added a comment - sending a patch fro install.xml and upgrade; some fields used in foreign keys did have a bad type too - maybe we should check all ints and detect the signed trouble there too.
Hide
Eloy Lafuente (stronk7) added a comment -

Patch sent to CVS (HEAD). Going to modify the utility to search also those wrongly signed fields (mysql only).

Show
Eloy Lafuente (stronk7) added a comment - Patch sent to CVS (HEAD). Going to modify the utility to search also those wrongly signed fields (mysql only).
Hide
Eloy Lafuente (stronk7) added a comment -

Done. Now, under MySQL, wrongly signed ints are also detected and changed. Closing this.

Show
Eloy Lafuente (stronk7) added a comment - Done. Now, under MySQL, wrongly signed ints are also detected and changed. Closing this.
Hide
Tim Hunt added a comment -

This just popped up on my to-test list because someone added a comment. It was actually done nearly a year ago! Anyway, I tested it and it works (apart from a regression in HEAD which I fixed), so closing now.

Show
Tim Hunt added a comment - This just popped up on my to-test list because someone added a comment. It was actually done nearly a year ago! Anyway, I tested it and it works (apart from a regression in HEAD which I fixed), so closing now.
Hide
Eloy Lafuente (stronk7) added a comment -

Thanks!

Show
Eloy Lafuente (stronk7) added a comment - Thanks!

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: