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().
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.
Includes following fixes:
* support for MS SQL Server
* optional trimming of of oversized VARCHAR fields
* conversion to forms library
* full localisation
* other cleanup
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
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.
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.
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.
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.
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.
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.
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.
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.