701 Commits

Author SHA1 Message Date
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
Petr Škoda
1dd74afe9e MDL-43604 add support for future hacky MariaDB versions
This patch also shows the real server version without
normalisation on the environment page, this should
hopefully help people to identify MariaDB...
2014-03-14 11:28:05 +08:00
Dan Poltawski
5a02170cb3 Merge branch 'MDL-44377' of https://github.com/stronk7/moodle 2014-03-03 15:15:23 +08:00
Tim Hunt
9eec598ca9 MDL-44251 fix typo in DML unit tests. 2014-03-02 09:41:17 +01:00
Eloy Lafuente (stronk7)
7b9ea861b6 MDL-44377 dml: enforce non-empty prefix for sqlsrv
Only MySQL is allowed to run Moodle instances without
(with an empty) database prefix. The rationale is that
"user" is a reserved word in every RDBMS but MySQL.

Before this patch, installation was breaking badly, when
the "user" CREATE TABLE statement was issued. With this
patch the error is shown earlier (on connection) preventing
any advance/use of the database.

This check is present in all the drivers, just sqlsrv was missing it.
2014-02-28 10:12:03 +01:00
David Monllao
3af7eea68d MDL-43882 dml: New test for perf_get_xxxx() methods 2014-02-21 13:21:13 +08:00
Sam Hemelryk
b2ca12e904 Merge branch 'MDL-43884-master' of git://github.com/ankitagarwal/moodle 2014-02-04 09:11:27 +13:00
Eloy Lafuente (stronk7)
6dcea23522 Merge branch 'w04_MDL-34055_m27_insertrecords' of https://github.com/skodak/moodle 2014-01-28 10:43:51 +01:00
Ankit Agarwal
aa611d661c MDL-43884 database: Fix get_tables() api for external stores 2014-01-28 16:28:57 +08:00
Petr Škoda
cc5dba8e54 MDL-34055 add bulk DB->insert_records() method
This patch was inspired by patch by Simon Coggins from Totara.
2014-01-28 10:41:43 +08:00
Sam Hemelryk
068ffec81b Merge branch 'w04_MDL-43761_m27_sqlinstall' of https://github.com/skodak/moodle 2014-01-27 14:30:57 +13:00
David Monllao
a922209e84 MDL-43758 performance: New metric, time spent by the database
This patch adds a new performance metric to the performance
info shown by MDL_PERF* vars, the time spent by the database,
it was one of the wonderful @poltawski ideas. To be more specific
the value displayed is the sum of the time elapsed between query_start()
and query_end().
2014-01-24 16:07:01 +08:00
Petr Škoda
b4b03d38b7 MDL-43761 execute bulk sql when modifying db structure
In case of postgresql this uses transactions to allow easier recovery from broken installs.
2014-01-24 13:47:41 +08:00
Petr Skoda
3f17d7091b MDL-43761 refactor db manager code to send arrays of SQL to the dml driver 2014-01-24 13:45:07 +08:00
Dan Poltawski
c582565a06 MDL-43395 dml: warn about invalid limit params
Help developers to find bugs by throwing a DEBUG_DEVELOPER message
rather than ignoring this case completely.
2014-01-13 08:42:07 +08:00
Sam Hemelryk
37f59a68bd Merge branch 'MDL-41359-master' of https://github.com/mr-russ/moodle 2013-12-18 10:08:33 +13:00
Sam Hemelryk
9d771f9529 Merge branch 'MDL-39725_analyze' of https://github.com/mr-russ/moodle
Conflicts:
	lib/dml/moodle_database.php
2013-12-17 09:31:19 +13:00
Russell Smith
814c9438a0 MDL-39725 database: Add statistics collection functions 2013-12-10 20:31:47 +11:00