737 Commits

Author SHA1 Message Date
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
Marina Glancy
308ce5b46f MDL-55827 tests: @ does not suppress wrong number of arguments in php7.1 2016-09-06 15:37:30 +08:00
Dan Poltawski
763c5b0eb4 Merge branch 'MDL-48856' of https://github.com/mr-russ/moodle 2016-08-08 14:45:06 +01:00
Russell Smith
e868574f02 MDL-48856 dmllib: Adjust performance improvements. 2016-07-22 11:52:41 +10:00
Tony Levi
73d37b20ed MDL-48856 pgsql: Performance tuning 2016-07-21 10:31:41 +10:00
Eloy Lafuente (stronk7)
5281e6a082 MDL-52544 oracle: small tweaks
This commit just:

- Moves the null => '' to better place, restricting it to PHP >= 7.0
  (bug https://bugs.php.net/bug.php?id=72524)
- Adds a couple of notes here and there.
- Changes some small details to keep the file using the same coding.
2016-07-19 04:04:32 +02:00
Damyon Wiese
eea2fc4319 MDL-52544 oracle: php7 fixes for oci driver
These are our bugs actually - the oci docs are very clear that bound
params should be in-scope when oci_execute is called - and due to pass by value etc,
this was not true for our driver.

There is another bug that needed fixing - OCI barfs if null values are bound - this
can be avoided by setting them to '' which oci treats as null.

And finally - all our lob/clob/blob hacks were also binding to local "out-of-scope" vars.
2016-07-12 16:55:47 +08:00
Russell Smith
1b0b082a08 MDL-54947 database: Update PostgreSQL binary handling.
PostgreSQL 9.1 allows hex formating for binary which is handled better
by pg_query_params().

Getting bytea isn't required on connection, it can be used as pg_field_type()
when binary needs to be checked.
2016-06-30 12:58:53 +10:00
Eloy Lafuente (stronk7)
4ae653024d MDL-53944 dml: make char2real() for mysql to support decimals
- With the patch, 6 positions of scale accuracy are guaranteed
  per individual casted value.
- Backed with unit tests, both for varchar and clob.
- Added 2 missing tests about uses of the method with params
  and values.

Note: 6 was picked because looking to all databases implementation
postgres was found to be casting to real, aka, 6.
2016-05-06 09:27:32 +08:00
David Monllao
a696bb9ebd MDL-51374 dml: Identifying the cache with connection data 2016-03-16 17:17:39 +08:00
David Monllao
ad90c7a5d5 MDL-51374 dml: Delete selectively instead of purge for tmptables 2016-03-16 10:48:41 +08:00
David Monllao
ef474575e1 Merge branch 'MDL-51374-master-new' of git://github.com/lameze/moodle
Conflicts:
	lib/db/caches.php
2016-03-16 10:13:14 +08:00
Simey Lameze
87a3e50192 MDL-51374 core_dml: change database layer to pass table name as parameter 2016-03-15 14:43:45 +08:00
Simey Lameze
26e7eceefc MDL-51374 cache: add temp_tables cache definition
Also a helper method get_temp_tables_cache() has been created for temporary tables cache operations.
2016-03-15 10:57:43 +08:00
Eric Merrill
208a79c920 MDL-53430 dml: Fix recordset_walk for additional parameters 2016-03-10 16:32:02 -05:00
Russell Smith
d22a01fd99 MDL-53213 caching: Faster databasemeta caching for all databases. 2016-02-28 17:03:14 +11:00
Petr Skoda
267ac1b9eb MDL-52511 dml: add support for PostgreSQL 9.5
The default definition behaviour has changed for some int values.
2016-02-10 09:45:07 +00:00
Mark Nelson
62d020ea22 MDL-49824 core_dml: final deprecation of set_logging() 2016-01-06 10:31:38 +08:00
Rajesh Taneja
e487a51db3 MDL-52060 phpunit: Keep track of modified database for reset
Keep list of modified tables, so they can be reset
without any guess work
2015-12-22 15:37:40 +08:00
Mark Nielsen
d494306de7 MDL-52060 phpunit: Prevent querying database metadata 2015-12-22 13:40:38 +08:00
Marina Glancy
1766e6a17f MDL-52284 core: PHP7 engine errors have type Throwable 2015-12-10 10:49:37 +08:00
Tony Levi
d74b7e424f MDL-52284 core: compatibility with Exception/Throwable changes in PHP7 2015-12-10 10:49:36 +08:00
Marina Glancy
57ee89569a MDL-50633 dml: deprecated var replaced in mysql 5.7
Thanks to Charles Verge for providing a patch
2015-11-02 21:05:20 +08:00
Eloy Lafuente (stronk7)
ec3aa5be7d MDL-49482 sqlsrv: Implement support of Offset/Fetch in SQL Server 2012+ 2015-09-24 20:07:51 +02:00
Jakub Kania
918187a062 MDL-49482 mssql: Implement support of Offset/Fetch in SQL Server 2012+. 2015-09-24 20:07:51 +02:00
David Monllao
2bdeb8ef30 MDL-51052 dml: More info about mysql and case & accent sensitiveness 2015-09-18 11:45:53 +08:00
Charles Fulton
3d47155643 MDL-51052 dml: support for sql_like() under utf8_bin 2015-09-18 09:56:43 +08:00
Eloy Lafuente (stronk7)
48657a6713 MDL-51245 sqlsrv: Diagnose missing READ_COMMITTED_SNAPSHOT mode
Without it, transactions are executed in standard READ_COMMITED
mode, without snapshoting/row versioning, leading to update
conflicts under high concurrency.
2015-09-08 02:55:53 +02:00
Eloy Lafuente (stronk7)
a9daab4927 MDL-51245 mssql: Diagnose missing READ_COMMITTED_SNAPSHOT mode
Without it, transactions are executed in standard READ_COMMITED
mode, without snapshoting/row versioning, leading to update conflicts
under high concurrency.
2015-09-08 02:55:45 +02:00
Eloy Lafuente (stronk7)
789d40a803 Merge branch 'MDL-49293-master' of git://github.com/andrewnicols/moodle 2015-08-11 22:58:09 +02:00
Eloy Lafuente (stronk7)
15c0a85071 MDL-50771 oracle: Bind long (>4000byte) text as CLOB
While we already were detecting @ normalise_value()
both BLOBs and CLOBs properly on insert and update
statements (by introspectind the column specs), when
a long TEXT is being passed as part of an arbitrary
SQL, or within the conditions... it was being bound
as VARCHAR, leading to problems if used in combination
with DBMS_LOB functions.

This patch just ensures that any TEXT > 4000 bytes not
detected by normalise_value() will be, always, bound as CLOB,
unconditionally.

Covered with tests both covering its use with DBMS_LOB (the
reported bug) and also in general raw statements.
2015-08-03 10:50:56 +02:00
Mark Nelson
17a3781259 MDL-49551 core_dml: deprecated set_logging() 2015-04-13 19:30:08 -07:00
Dan Poltawski
6755498637 Merge branch 'MDL-48595_master' of git://github.com/dmonllao/moodle
Conflicts:
	version.php
2015-03-10 09:59:28 +00:00
David Monllao
ad23227bd6 MDL-48595 core_dml: Adding a recordset walker 2015-03-09 08:25:14 +08:00
Mark Nelson
71611510a0 MDL-46064 install: prevent install/upgrade with MyISAM 2015-03-05 22:29:34 -08:00
Andrew Nicols
9b16c1af2c MDL-49293 db: Pass sql_concat_join to sql_concat 2015-03-06 11:56:46 +08:00