718 Commits

Author SHA1 Message Date
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
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
Andrew Nicols
29e2563a6d MDL-49293 db: Test sql_concat_join with more conditions 2015-03-06 11:36:31 +08:00
pau.ferrer-ocana
dd379d9af4 MDL-49234 oracle: Remove variables passed by reference error 2015-02-18 16:54:17 +01:00
Eloy Lafuente (stronk7)
5d98ba68f5 MDL-35155 database: better sql_substr() impl. for mssql/sqlsrv + unit tests
MSSQL's substring() implementation is somehow silly/strict and unable to
perform implicit casts to integer both for the start and length parameters.

This hits Moodle badly because of another problems (MDL-23997) we decided
to cast to string all bound placeholders long ago.

So this commit just enforces the cast of the start and length parameters to
integer. And includes unit tests for using placeholders on all positions in
the sql_substr() method.
2015-01-15 08:32:38 +00:00
Dan Poltawski
9581dff081 MDL-35155 dml: add unit test which exposes substr problem
Previously, when using parameters, substring broke on mssql.
2014-12-31 15:17:16 +00:00
Simon Coggins
e53364b62f MDL-35155: Fix MSSQL bug in sql_substr() 2014-12-31 15:14:58 +00:00
Marina Glancy
253b93f720 Merge branch 'wip_MDL-48083_m28_rollback' of git://github.com/skodak/moodle 2014-11-06 11:42:10 +08:00
Petr Skoda
5cf50f96e7 MDL-48083 dml: Empty buffers on forced rollback 2014-11-06 15:52:37 +13:00
Dan Poltawski
c293eb004b Merge branch 'MDL-47874' of git://github.com/stronk7/moodle 2014-11-05 14:27:12 +00:00
Eloy Lafuente (stronk7)
bacbb4e279 MDL-47874 dml: add support for replace_all_text to oracle
And, at the same time, fix the implementation so all databases
will be using sql_substr() instead of harcoded "SUBSTRING".
2014-11-02 18:26:18 +01:00
Julien Boulen
9b45b74e8f MDL-47584 database SQL: add debug info on connection error notices 2014-10-29 16:59:56 +08:00
Damyon Wiese
0cc1ee1f30 MDL-46171 dml: DML unit test for tricky SQL in assign upgrade
This tests a workaround for set_field_select where the set table and from table are the same.
2014-09-30 23:35:37 +08:00
Marina Glancy
3b4db5bdf5 MDL-44725 dml: added sql_intersect() 2014-09-03 13:33:58 +08:00
Petr Skoda
a45d54b8cb MDL-46235 ddl: add support for large number of text fields in one database table 2014-08-25 12:40:57 +12:00
Petr Skoda
349f98ad3e MDL-45941 implement support for message sending from DB transactions and fix other problems
This patch includes following fixes:
 - messages may be now sent when database transactions active
 - consistent return status on failure from message_send(), false is
   returned only when message not created in message(_read)? table,
   processor failure results in debugging message only and messages
   are not marked as read
 - message_sent is triggered always with id from message table
 - logic for marking messages as viewed was standardised
 - message_viewed event is triggered consistently
 - improved performance when fetching user preferences
 - full unit tests coverage for send_message() function
 - fixed multiple other smaller issues discovered by unit tests
2014-06-17 16:09:43 +12:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Petr Škoda
6b7da257af MDL-45070 relax the mariaDB version checker to work with long Ubuntu versions
Example of Ubuntu version: 5.5.5-10.0.10-MariaDB-1~saucy-log
2014-04-14 09:44:45 +08:00
Petr Škoda
96255f472c MDL-44862 always add dbport to dbsocket in pg driver
This should hopefully resolve problems when using sockets connection
to pg servers running on non-standard ports.
2014-03-30 10:06:39 +08:00
Marina Glancy
ea406e6b94 Merge branch 'w12_MDL-44624_m27_dmltest' of git://github.com/skodak/moodle 2014-03-17 18:12:16 +08:00
Petr Škoda
ce1f5ed57a MDL-44624 fix false failures in DML tests 2014-03-14 14:14:10 +08:00