-
Bug
-
Resolution: Fixed
-
Minor
-
2.0.7, 2.1.4, 2.2.1, 2.6
-
PostgreSQL
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_26_STABLE
-
MOODLE_26_STABLE
-
w50_
MDL-31625_m27_replace -
-
-
13
-
BACKEND Sprint 7
If a column is at the constrained limit like mdl_log - url, then if you replace it with a new url larger, that the search url will fail.
Error writing to database
|
|
More information about this error
|
|
Debug info: ERROR: value too long for type character varying(100)
|
UPDATE mdl_log SET url = REPLACE(url, $1, $2)
|
[array (
|
0 => 'http://localhost/moodle',
|
1 => 'http://localhost/moodle21',
|
)]
|
Stack trace:
|
line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
|
line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
|
line 596 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
|
line 6281 of /lib/adminlib.php: call to pgsql_native_moodle_database->execute()
|
line 47 of /admin/replace.php: call to db_replace()
|
Jason Ilicic and I have made some fixes to the db_replace() function to fix database issues when running it.
- Running the replace command on fields that don't have the search url in it.
- In PostgreSQL, update creates another row and tags the old row was re-usable but effectively doubling the Database size.
- Replacing a URL that is greater than original and making the column larger that DB constraints.
- If column is 100 chars (mdl_log - url) and data is 100 chars, an update will fail if replace url is greater that search url.
- Replace the search url if the column is equal or greater that the size of the search url.
- has been marked as being related by
-
MDL-47874 Test Oracle support of REPLACE function
-
- Closed
-