772 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
0de29dbf35 MDL-63020 tests: ensure that searching for is null values also works ok 2018-09-24 17:38:10 +02:00
Tim Hunt
eb6c769a8c MDL-63020 dml: improve the unit tests 2018-09-24 11:41:25 +01:00
Tim Hunt
5abc431335 MDL-63020 ddl: fix nullable unique indexes in OCI and MS SQL
This works-around the default non-standard behaviour of these DB engines.
2018-09-20 17:41:22 +01:00
Tim Hunt
54b2b1d27f MDL-63020 xmldb: Improve PHPdoc comments for better IDE autocomplete 2018-09-20 17:41:22 +01:00
Matteo Scaramuccia
82c2d98fa2 MDL-61702 dml: MariaDB 10.3 supports only the Barracuda file format.
More details about this change also in https://tracker.moodle.org/browse/MDL-59099

Ref.: https://mariadb.com/kb/en/library/mariadb-1031-release-notes/#other-variables
2018-05-31 22:55:00 +02:00
David Monllao
17ed12eb17 Merge branch 'm35_MDL-59596_DDL_Issues_With_MariaDB_10p2_SQLMode' of https://github.com/scara/moodle 2018-05-28 08:15:09 +02:00
Jake Dallimore
48c3e99599 MDL-59581 database: remove mssql specific code from lib/dml 2018-04-09 01:58:26 +02:00
Matteo Scaramuccia
f6b16e95a8 MDL-59596 ddl: Added has_breaking_change_sqlmode() 2018-03-26 23:12:36 +02:00
David Monllao
c2e970779d MDL-53226 search_simpledb: Refine the patch
- Clumsy fallback only when there is no full-text search support
- Mimic solr tests
- pgsql tokenization using simple configuration
- workaround for mysql '*' search issue
- total results proper calculation
- SQL server FTS support
- Standarize dml full-text search checkings
- Upgrade note about the new dml method
- Set search_simpledb as default engine if no solr config
2018-03-20 18:49:38 +01:00
Matteo Scaramuccia
bccbd3b4eb MDL-61626 core_dml: pgsql and schema qualification. 2018-03-11 22:56:36 +01:00
Eloy Lafuente (stronk7)
5405354d88 MDL-61240 dml: php72 compatibility, avoid counting on non-countables
This was not detected earlier because we have been unable to
run sqlsrv + php72 till now (not available).
2018-01-19 00:59:16 +01:00
Jake Dallimore
fa2a9cc933 MDL-23887 database: fix use of deprecated system tables for mssql
Catalog views are available which we should use instead.
2018-01-02 17:19:17 +08:00
Damyon Wiese
8cae085071 Merge branch 'MDL-60976-master' of https://github.com/matt-catalyst/moodle 2017-12-12 09:56:20 +08:00
Neill Magill
61fad215f1 MDL-60041 dml: MOODLELIB sql file must have Unix line endings
If the file does not have Unix line endings then the regular expression
in oci_native_moodle_database::attempt_oci_package_install() does
not split it correctly.

This leads to an invalid package being created in Oracle.

The .gitattribute file changes for oci_native_moodle_package.sql
force it to have Unix style line endings when the branch is checked
out and the file does not already exist.

The file has been modified so that the Unix style line endings are
applied even if the file already exists, for example when pulling in
this change to an existing branch.
2017-12-11 08:40:58 +00:00
Matt Clarkson
1c06098b6b MDL-60976 dml: Optimise replace_all_text()
Avoid updating fields that do not match the search string.
2017-12-08 12:35:56 +13:00
sam marshall
ed00d67c99 MDL-60174 core_dml: get_recordset on Postgres eats all the RAM
On Postgres, get_recordset_sql loads all the results into memory
(within the Postgres library, which doesn't count towards the PHP
memory limit, but does count towards making your server run out of
memory) as soon as the query completes.

This commit changes the code to use cursors, which in Postgres
allow the results to be returned in smaller chunks (by default
100,000 rows).
2017-11-27 11:10:29 +00:00
Matteo Scaramuccia
740a9315c3 MDL-59099 dml: MySQL8 supports only the Barracuda file format.
The following InnoDB file format configuration parameters were deprecated
in MySQL 5.7.7 and are now removed:
- innodb_file_format
- innodb_file_format_check
- innodb_file_format_max
- innodb_large_prefix

File format configuration parameters were necessary for creating tables
compatible with earlier versions of InnoDB in MySQL 5.1.
Now that MySQL 5.1 has reached the end of its product lifecycle,
the parameters are no longer required.

The FILE_FORMAT column was removed from the INNODB_SYS_TABLES and
INNODB_SYS_TABLESPACES Information Schema tables.

Ref: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-0.html
2017-10-27 17:38:36 +02:00
Matteo Scaramuccia
500d8650d2 MDL-59100 dml: Lower the case of INFORMATION_SCHEMA.* fields. 2017-10-21 14:30:38 +02:00
David Monllao
b1a9a6a19a Merge branch 'wip-MDL-60281-master' of git://github.com/marinaglancy/moodle 2017-10-17 09:45:44 +02:00
Marina Glancy
109fbd5a15 MDL-46269 dml: Add casesensitive argument to sql_regex() 2017-10-16 16:53:46 +08:00
Marina Glancy
484b43f456 MDL-60281 general: create_function is deprecated in PHP7.2 2017-10-16 09:37:19 +08:00
Matteo Scaramuccia
ea34d02d55 MDL-59635 tool_replace: Escape the column name. 2017-09-04 11:46:55 +02:00
Andrew Nicols
ee640d3f2d Merge branch 'm34_MDL-59583_Fix_MariaDB_10d2d7_Breaking_Change' of https://github.com/scara/moodle 2017-08-03 12:29:56 +08:00
Matteo Scaramuccia
2ec50fe3fd MDL-59583 dml: fixed NULL values w/ MariaDB 10.2.7+ 2017-08-03 00:13:03 +02:00
Andrew Nicols
2653e0c8e1 Merge branch 'm34_MDL-59583_Fix_MariaDB_10d2d7_Breaking_Change' of https://github.com/scara/moodle 2017-07-31 11:37:45 +08:00
Dan Poltawski
afa752eb12 Merge branch 'MDL-57698-master' of https://github.com/xow/moodle 2017-07-25 11:48:09 +01:00
Matteo Scaramuccia
0510d5c757 MDL-59583 dml: fixed breaking change added w/ MariaDB 10.2.7+ 2017-07-25 12:36:23 +02:00
Matteo Scaramuccia
dae6c5dc31 MDL-59583 dml: improve perfs by unsetting the key. 2017-07-25 09:06:18 +02:00
David Monllao
b4e55d3a37 Merge branch 'MDL-59509-master' of git://github.com/andrewnicols/moodle 2017-07-24 13:03:10 +02:00
Dan Poltawski
9c0cdc069b Merge branch 'MDL-59572-master' of git://github.com/andrewnicols/moodle 2017-07-24 09:54:39 +01:00
John Okely
9726144ef3 MDL-57698 sqlsrv: Unit test NOLOCK 2017-07-21 14:41:55 +08:00
John Okely
b540fd1a80 MDL-57698 sqlsrv: Query temp tables with no lock 2017-07-21 14:41:54 +08:00
Andrew Nicols
e879619477 MDL-59509 dml: sqlsrv should respect port setting
Details of how to connect to a specific port are available at
https://docs.microsoft.com/en-us/sql/connect/php/how-to-connect-on-a-specified-port
2017-07-21 13:23:17 +08:00
Adrian Greeve
3a8c989137 MDL-59561 database: Update to creating new indexes in mysql.
When updating the mysql system to utf8mb4 not all tables are
converted to the row format of compressed or dynamic. If a new
index is created there is a possibility that the table could be
using compact or redundant and then an error will be shown saying
that the index size is too large. This fix handles this exception
and converts the table over to compressed.
2017-07-21 09:27:08 +08:00
Andrew Nicols
9790a9b583 MDL-59572 dml: Call error_log for AJAX/WS calls 2017-07-19 12:49:15 +08:00
Marina Glancy
f2b5ed40f9 MDL-58689 dml: prevent logging during setup 2017-04-27 10:07:01 +08:00
David Monllao
996731dded Merge branch 'MDL-45584_master' of git://github.com/markn86/moodle 2017-03-07 12:00:01 +01:00
Russell Smith
f3789f2fb3 MDL-45584 cache: Make identifiers part of the cache creation.
It is now safe to cache a reference to a cache and expect consistent results.

Changing identifiers altered cache results where a reference was
held to the cache. Identifiers have been set to be cached with
identifiers included so the caches are separate.

As a consequence of this it was identified that invalidation events
and identifiers don't easily work together as an event can't determine
which identifiers should be used for cache invalidation.  So invalidation
events have been made incompatible with identifiers being set.  No core
code used this combination as it's not possible to understand any expected
behaviour.

Event invalidation for application and session caches was centralised to the same
location.  The only difference was the name of the lastinvalidation variable. This
improves support and consistency of invalidation code.
2017-03-02 11:06:17 +08:00
Adrian Greeve
8c1288dbdb MDL-48228 database: Unit test addition and update. 2017-03-01 09:03:12 +08:00
Adrian Greeve
0bbefd81cd MDL-48228 database: Make utf8mb4 the default character set for mysql.
Thanks to Jetha Chan for providing the initial patch that this is
based on.
2017-03-01 09:03:12 +08:00
Ankit Agarwal
c728b45904 MDL-57192 dml: Temporarily disable query logging during setup 2017-01-03 17:24:21 +05:30
Ankit Agarwal
c14fe2cb03 MDL-57192 dml: Support temporarily disabling query logs during setup 2017-01-03 17:24:21 +05:30
Luke Carrier
6f62abab2c MDL-57143 dml: sqlsrv drivers are going xplat \o/
They're now available on PECL:
    https://pecl.php.net/package/sqlsrv

And the source for the extension is on GitHub:
    https://github.com/Microsoft/msphpsql

Note that they do require installation of unixODBC; relevant
documentation is available for Debian- and RHEL-likes:
* https://www.microsoft.com/en-us/sql-server/developer-get-started/php-ubuntu
* https://www.microsoft.com/en-us/sql-server/developer-get-started/php-rhel
2016-12-01 22:08:57 +00:00
Eloy Lafuente (stronk7)
64573a35e9 Merge branch 'MDL-55124' of https://github.com/mr-russ/moodle 2016-09-22 00:52:30 +02:00
Russell Smith
d59f1d3150 MDL-55124 database: Mode connection test to after connection.
To verify the client encoding and other data is correct then
the connection must have been made first.
2016-09-22 08:40:03 +10:00
Eloy Lafuente (stronk7)
ce7863ba36 Merge branch 'MDL-55124' of https://github.com/mr-russ/moodle 2016-09-20 12:13:10 +02:00
Russell Smith
f834a8f5eb MDL-55124 database: Allow option to not send options.
pgbouncer doesn't accept the PostgreSQL options command as it can't
process it.  If you are using pgBouncer you need to make sure your
database is configured to set client encoding and standard_conforming_strings
correctly on each connection.  pgBouncer can do this, as can ALTER
commands.

Also using sockets without a filename did not allow different ports to work.
This is because you either specify a filename which includes a port or
you just specify a port and libpq works out the correct socket location.
2016-09-20 19:53:01 +10:00
Eloy Lafuente (stronk7)
8dcc999d96 Merge branch 'wip-MDL-55827-master' of git://github.com/marinaglancy/moodle 2016-09-20 01:02:06 +02:00
Eloy Lafuente (stronk7)
03d27c303d MDL-29332 tests: Cover the new sql_equal() function
- For CS, CI and AS
- Not for AI (it's not cross-db)
- equal (=) and not equal (<>)
- delete old test_sql_binary_equal() now with cross-db solution.
2016-09-15 16:33:08 +02:00
Eloy Lafuente (stronk7)
9d5c12bee4 MDL-29332 dml: new sql_equal() to force cs/ci behavior on varchar matching 2016-09-15 16:33:00 +02:00