863 Commits

Author SHA1 Message Date
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
Russell Smith
9c7dfbe6ed MDL-41359 database: no table columns is a dml_excpeiton
When insert_record is called and it doesn't find any columns
to insert data into, that is a dml_exception as you need at least
one column in the database to insert into it.  This can happen
when you have created a zero column database table, or the table
does not exist.
2013-12-07 08:56:24 +11:00
Petr Škoda
6c3ae510f1 MDL-31625 fix multiple global search-replace issues
Includes following fixes:
* support for MS SQL Server
* optional trimming of of oversized VARCHAR fields
* conversion to forms library
* full localisation
* other cleanup
2013-12-06 09:51:49 +08:00
Marina Glancy
2e84b4b323 Merge branch 'MDL-42775-master' of git://github.com/danpoltawski/moodle 2013-11-08 16:37:55 +11:00
Dan Poltawski
356d33a866 MDL-42775 dml: remove invalid unit test assertion 2013-11-08 12:25:49 +08:00
Ankit Agarwal
6cff6350df MDL-41586 libaries: Fix issues with scale in sqlsrv libraries
0 is a valid value
null is the default scale we set in other DBs
2013-11-08 10:49:35 +08:00
Ankit Agarwal
e3359b87df MDL-41586 libraries: Fix scale issues
The default value of scale should be null not false in mssql, that is the
standard with other DBs
0 is a valid value for scale, don't change it in oracle
2013-11-06 16:12:15 +08:00
Petr Škoda
302506e03a MDL-42493 revert nasty DB meta caching hack that was trying to work around shutdown issues
The original problem was resolved via new core shutdown handler support.
2013-10-25 21:20:06 +02:00
Petr Škoda
38fc013025 MDL-42040 refactor core Moodle shutdown handlers logic 2013-10-04 11:36:46 +02:00
Petr Škoda
d79d5ac276 MDL-31501 rework user session architecture
List of changes:
 * New OOP API using PHP namespace \core\session\.
 * All handlers now update the sessions table consistently.
 * Experimental DB session support in Oracle.
 * Full support for session file handler (filesystem locking required).
 * New option for alternative session directory.
 * Official memcached session handler support.
 * Workaround for memcached version with non-functional gc.
 * Improved security - forced session id regeneration.
 * Improved compatibility with recent PHP releases.
 * Fixed borked CSS during install in debug mode.
 * Switched to file based sessions in new installs.
 * DB session setting disappears if DB does not support sessions.
 * DB session setting disappears if session handler specified in config.php.
 * Fast purging of sessions used in request only.
 * No legacy distinction -  file, database and memcached support the same functionality.
 * Session handler name included in performance info.
 * Fixed user_loggedin and user_loggedout event triggering.
 * Other minor bugfixing and improvements.
 * Fixed database session segfault if MUC disposed before $DB.

Limitations:
 * Session access time is now updated right after session start.
 * Support for $CFG->sessionlockloggedinonly was removed.
 * First request does not update userid in sessions table.
 * The timeouts may break badly if server hosting forces PHP.ini session settings.
 * The session GC is a lot slower, we do not rely on external session timeouts.
 * There cannot be any hooks triggered at the session write time.
 * File and memcached handlers do not support session lock acquire timeouts.
 * Some low level PHP session functions can not be used directly in Moodle code.
2013-09-21 13:11:56 +02:00
Petr Škoda
bff1d60c05 MDL-40676 ignore null bytes 2013-09-02 12:25:02 +08:00
Petr Škoda
9d6d32b6f0 MDL-41022 cleanup core_dml_testcase 2013-08-24 16:18:02 +02:00
Dan Poltawski
6f44a73369 Merge branch 'w33_MDL-39474_m26_debugdeveloper' of https://github.com/skodak/moodle
Conflicts:
	lib/upgrade.txt
2013-08-20 11:42:03 +08:00
Simon Coggins
be8c6d7bc8 MDL-39572: Fix sql_order_by_text() to use length argument correctly 2013-08-16 11:26:54 +12:00
Simon Coggins
be4bf53d6d MDL-39572: Fix existing tests and add more to demonstrate issue with sql_order_by_text() 2013-08-16 11:26:54 +12:00
Petr Škoda
96f81ea385 MDL-39474 introduce $CFG->debugdeveloper and cleanup $CFG init 2013-08-12 13:01:47 +02:00
Petr Škoda
8252b7c291 MDL-40901 standardise core test case class and file names
This finally allows us to type only the class name when executing individual core test cases.
2013-08-04 22:10:31 +02:00
Petr Škoda
656250de83 MDL-11270 use NVARCHAR(MAX) and VARBINARY(MAX) in SQL Server 2013-07-26 09:28:50 +02:00
Petr Škoda
d11b8d0c63 MDL-40808 remove unused DML strings 2013-07-25 12:02:29 +02:00
Petr Škoda
17601a7e12 MDL-39985 add explicit MariaDB support 2013-07-24 10:45:20 +08:00
Eloy Lafuente (stronk7)
154bc6b240 Merge branch 'w30_MDL-40642_m26_umask' of https://github.com/skodak/moodle 2013-07-23 23:42:11 +02:00
Petr Škoda
eb459f7192 MDL-40642 set more restrictive umask and use proper permission for new dirs and files 2013-07-19 09:18:44 +02:00
Petr Škoda
d8a1f4263a MDL-39846 implement new event dispatching and base event class 2013-07-19 08:43:27 +02:00
Damyon Wiese
b080d5b688 Merge branch 'wip-MDL-40490-master' of git://github.com/abgreeve/moodle 2013-07-09 10:03:22 +08:00
Adrian Greeve
b1d31f49dc MDL-40490 - database: Fixed a check on database port options.
The addition of a port for the database means that an array
would be set regardless of whether it had any information or not.
The isset() function sees an array as being set and follows through
with the rest of the if statement concatenating a colon to the end
of the database host name and throwing a connection problem if no port
number is supplied.

The if statement has now been changed to if not empty. The empty
function does see zero as an empty value, but a port shouldn't have
a value of zero anyway.
2013-07-04 15:01:53 +08:00
Dan Poltawski
b25cd1f3d5 Merge branch 'w27_MDL-40399_m26_msarrayshift' of https://github.com/skodak/moodle 2013-07-02 13:34:09 +08:00
Petr Škoda
7aed7f46ab MDL-40266 improve emulate_bound_params() for mssql driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-01 08:52:03 +02:00
Petr Škoda
b983901d48 MDL-40266 improve emulate_bound_params() for sqlsrv driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-01 08:51:35 +02:00
Martin Langhoff
4f3e38e745 MDL-40266 improve emulate_bound_params() for mysqli
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.
2013-06-30 18:25:14 +02:00
Petr Škoda
8ac7cbddfc MDL-39588 require MOODLELIB Oracle package
Previously it was kind of optional, but it is now required. We also attempt to install it automatically now.
2013-06-02 11:14:43 +02:00
Dan Poltawski
e947caf4a1 Merge branch 'MDL-39389' of git://github.com/stronk7/moodle 2013-04-29 14:15:23 +01:00
Dan Poltawski
1f65889ab3 Merge branch 'MDL-39390' of git://github.com/stronk7/moodle 2013-04-29 14:12:37 +01:00
Eloy Lafuente (stronk7)
20c9916396 MDL-27071 Allow Oracle IN() to use > 1000 items
By using a pivoting strategy, we modify the list
of params (QM and NAMED supported) into a
subquery, so the 1000 limit in Oracle (ORA-01795)
is not thrown anymore.
2013-04-29 01:22:38 +02:00
Eloy Lafuente (stronk7)
9b2ebc4587 MDL-27071 Add big IN() unit tests
Let's verify how all databases perform with a big
number of parameters (10000) using IN() SQL clauses.
Both using QM and NAMED parameters.

Ideally only Oracle fails, and only it will need fixing.
2013-04-29 01:11:10 +02:00
Eloy Lafuente (stronk7)
bae2846c2c MDL-39390 delete old moodle_database column cache
With MDL-39389 all the remaining drivers have been moved
from the in-memory, per-request ::columns cache to
the MUC (databasemeta) alternative.

That makes the old cache unused, so this is, simply about to
delete it, and warn in upgrade notes for potential sites
using custom moodle_database drivers.
2013-04-28 18:33:33 +02:00
Eloy Lafuente (stronk7)
f33d4784fe MDL-39389 add databasemeta cache to pdo_sqlite
Done in a separate commit, coz this driver is not
truly supported, but considering it as a reference
for people developing drivers... it's better to
have it supporting the databasemeta cache.
2013-04-28 18:14:17 +02:00
Eloy Lafuente (stronk7)
9043466103 MDL-39389 add databasemeta cache to ms/oci drivers 2013-04-28 18:12:38 +02:00
Eloy Lafuente (stronk7)
552f00fb86 Merge branch 'w14_MDL-38750_m25_ocierrors' of git://github.com/skodak/moodle 2013-04-09 02:26:49 +02:00
Eloy Lafuente (stronk7)
13af1f0497 Merge branch 'w14_MDL-39038_m25_oracleconcat' of git://github.com/skodak/moodle 2013-04-09 02:23:36 +02:00