Commit Graph

237 Commits

Author SHA1 Message Date
Tim Hunt e8bfeea06c MDL-79780 DML: add the missing get_fieldset method 2023-12-22 12:09:41 +00:00
Sara Arjona cc9430929d MDL-77708 docs: Update references from docs.moodle.org/dev 2023-09-26 10:30:19 +02:00
Eloy Lafuente (stronk7) d2b6a1b7f3 MDL-76459 dml: Remove other remaining harcoded uses of old 28 & 30
Let's require lib/ddllib.php and use the constant properly,
so we don't need to go searching for cases in future changes.

They are a hand of files, but already are included often each
time the database manager is included. Possible alternative
for this, if we want to reduce the number of included files
is to move the constants to xmldb_constants and only include
that file, but I don't think that makes much sense.

Also, fix the xmldb schema definition to validate table and
column names with the new allowed lengths.
2023-09-02 09:22:13 +02:00
Marina Glancy 8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Matteo Scaramuccia b82c95a075 MDL-74912 mod_forum: Fix regexp word boundaries markers in MySQL 8 2022-11-05 10:07:26 +01:00
Andrew Nicols 9911faf8be Merge branch 'MDL-75614-debugsqltrace' of https://github.com/brendanheywood/moodle 2022-09-30 16:36:10 +08:00
Alex Morris 70dfee9e23 MDL-75170 dml: add sql_order_by_null method
Standardises return patterns of null values across database types
to keep with sorting nullsto the top when ascending, and
to the bottom when descending
2022-09-30 11:27:26 +13:00
Sara Arjona eef0a430be Merge branch 'MDL-75548' of https://github.com/timhunt/moodle 2022-09-05 13:09:09 +02:00
Brendan Heywood 11efc67eb5 MDL-75614 dml: Fixed debugsqltrace with anon classes bug 2022-09-02 11:42:04 +10:00
Srdjan 5248067884 MDL-71000 lib/dml: New query type SQL_QUERY_AUX_READONLY
For SQL_QUERY_AUX queries that can go to readonly, conditions permitting.
2022-08-23 10:39:43 +10:00
Tim Hunt 797b9fbd62 MDL-75548 misc: final Required parameter follows optional notices 2022-08-22 15:20:13 +01:00
Paul Holden 27f9929b52 MDL-72184 dml: implement driver methods for casting to char. 2022-06-12 19:31:34 +01:00
Paul Holden b2d19cc29f MDL-52817 dml: implement driver methods for SQL group concatenation. 2021-02-19 15:31:00 +00:00
Ruslan Kabalin 536fdb0c2f MDL-70055 pgsql DML: Support large number of SQL-IN parameters.
This patch adds a solution for Postgres that allows overriding IN
statement limit of 16bit (65535 values) by wrapping items in VALUES
list. This only takes place in number of items exceeds 65535, otherwise
parent class get_in_or_equal() function is used.
2020-12-24 14:39:21 +00:00
Tim Hunt dc72bc6ac5 MDL-54907 dml: Correct incorrect PHPdoc 2020-11-27 14:57:36 +00:00
sam marshall edb5cd0de4 MDL-69687 DB: Add API for deleting data based on subquery
The new API works on normal databases (by deleting data based on the
subquery) and also on MySQL (by deleting the data using a weird join
on the subquery).
2020-10-16 18:20:23 +01:00
Brendan Heywood ef4145dd1a MDL-68874 dml: Add SQL stacktrace debugging mode 2020-07-15 20:32:43 +10:00
Srdjan 46cfde3d95 MDL-19711 dml: Enable use of readonly slave database handles
Implemented with moodle_read_slave_trait

Functionality is triggered by supplying config dboption['readonly'].
See config-dist.php for more info on supported dboptions.

pgsql and mysqli drivers are using this feature. Also added support for
connection timeout for these two drivers.
2020-05-19 11:50:42 +10:00
Shamim Rezaie b4d062c6be MDL-58584 core: remove duplications from get_columns functions 2020-02-03 15:07:15 +11:00
Ryan Wyllie 30d2b9cd31 MDL-66110 dml: Fix MySQL v8 compatibility with groups table
MySQL v8 has added "groups" to the reserved word list. That is used
as a table name in Moodle so we have to quote it with backticks in the
SQL so that MySQL knows it's being used as an identifier.
2019-08-13 09:35:19 +08:00
Andrew Nicols 71cbc0550f MDL-65168 dml: Move preload SQL functions to self-contained class 2019-03-25 23:05:22 +01:00
Ryan Wyllie a30570c555 MDL-64820 dml: add object preloading helpers 2019-03-22 09:24:04 +08:00
Tim Hunt 54b2b1d27f MDL-63020 xmldb: Improve PHPdoc comments for better IDE autocomplete 2018-09-20 17:41:22 +01: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
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
Marina Glancy 109fbd5a15 MDL-46269 dml: Add casesensitive argument to sql_regex() 2017-10-16 16:53:46 +08:00
Matteo Scaramuccia ea34d02d55 MDL-59635 tool_replace: Escape the column name. 2017-09-04 11:46:55 +02:00
Andrew Nicols 9790a9b583 MDL-59572 dml: Call error_log for AJAX/WS calls 2017-07-19 12:49:15 +08: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
Ankit Agarwal c14fe2cb03 MDL-57192 dml: Support temporarily disabling query logs during setup 2017-01-03 17:24:21 +05:30
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
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
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
Russell Smith d22a01fd99 MDL-53213 caching: Faster databasemeta caching for all databases. 2016-02-28 17:03:14 +11: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
Mark Nelson 17a3781259 MDL-49551 core_dml: deprecated set_logging() 2015-04-13 19:30:08 -07: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
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
Marina Glancy 3b4db5bdf5 MDL-44725 dml: added sql_intersect() 2014-09-03 13:33:58 +08: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
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
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