117 Commits

Author SHA1 Message Date
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
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
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
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
d11b8d0c63 MDL-40808 remove unused DML strings 2013-07-25 12:02:29 +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
33b5b9f97a MDL-36809 add support for mysqli persistent connections 2013-01-19 13:25:28 +01:00
Petr Škoda
9d0ded6697 MDL-37284 fix mysql test for unicode compatibility 2012-12-22 18:42:55 +01:00
Petr Škoda
46a86dbbc2 MDL-36211 do not lock sessions for guests and not-logged-in users 2012-11-17 10:42:47 +01:00
Sam Hemelryk
9381983e5b MDL-25290 conversion: Added db column cache to pgsql + mysql 2012-10-19 08:08:59 +08:00
Petr Škoda
633f324896 MDL-35691 fix bogus mysql integer size detection 2012-10-10 10:33:18 +02:00
Petr Škoda
3c17c85ae6 MDL-35691 fix max length calculation in pg, mysql and our bigint checker 2012-10-06 10:07:48 +02:00
Petr Škoda
cabc411215 MDL-35129 implement new export_table_recordset()
This is necessary because MySQL get_recordset_sql() stores the data in memory, unfortunately the alternative resultset iteration blocks concurrent access - that is why we need new method for export.
2012-09-15 11:29:33 +02:00
Petr Škoda
a197c413c5 MDL-34441 prevent mysqli::close() notice after failed mysql driver connect 2012-07-22 15:38:03 +02:00
Petr Škoda
1eece17648 MDL-34271 use the same collation when adding new tables or columns 2012-07-12 14:39:36 +02:00
Petr Škoda
ed047dabc9 MDL-34271 cleanup mysql engine hack before adding similar collation hack 2012-07-12 14:39:36 +02:00
Petr Škoda
3c2fbdbb87 MDL-34010 improve mysqli engine diagnostics performace 2012-07-06 08:01:33 +02:00
Michael Aherne
445be5c6cd MDL-34010 Update diagnose() function to query information_schema.tables 2012-07-06 08:01:33 +02:00
Petr Skoda
00902cd974 MDL-32003 fix phpdocs and use __DIR__ for includes in dml layer
DML layer is not supposed to use $CFG,
it is better to rely on __DIR__ in self-contained libs…
2012-06-17 22:56:28 +02:00
Tomasz Muras
04bfa67c41 MDL-32930 Add escaping for '_' character 2012-05-11 08:56:01 +02:00
Tomasz Muras
c92e462b04 MDL-32930 Improve the performance of get_tables 2012-05-10 23:35:18 +02:00
Petr Skoda
4bf855771f MDL-32365 fix hardcoded auto-increment on id columns 2012-04-10 15:22:16 +02:00
Petr Skoda
3b4f7338a7 MDL-32365 fix invalid checking for returned id when custom sequence used 2012-04-10 15:22:15 +02:00
Petr Skoda
a3d5830a0a MDL-32149 PHPUnit test support - part 2
Includes:
* constants refactoring
* reworked db table init
* support for $CFG->debug = -1
* functional DB tests
* fixed $DB->get_indexes() to not throw exceptions when table does not exist
* fix handling of user passwords in test db
* add debug info to exception messages
* removed unnecessary PHP debug errors from mathslib
* fixed @error suppression in get_string
* fixed PHPUnit error handler setup
* added timezone info to default install
2012-04-03 22:30:53 +02:00
Dan Poltawski
d68c62fe12 Merge branch 'w12_MDL-29515_m23_deprdb' of git://github.com/skodak/moodle 2012-03-21 09:25:47 +08:00
Petr Skoda
de640a2d3f MDL-29515 remove deprecated $DB->sql_ilike() and fix debug messages 2012-03-17 19:20:39 +01:00
Petr Skoda
e618cdf3f6 MDL-29894 forbid objects in DML parameters
Objects with __toString we never fully supported as parameters in DML layer, this finally brings consistent behaviour.
2012-03-17 18:44:12 +01:00
Petr Skoda
bc09aa158b MDL-31899 use information_schema for normal db tables in get_columns()
This change is based on patch by Charles Fulton.
2012-03-10 21:41:44 +01:00
Petr Skoda
05aae0a571 MDL-29514 drop support for enum data types 2012-03-10 21:36:48 +01:00
Petr Skoda
a681b6c0a9 MDL-31689 fix moodle_database:execute() description 2012-03-07 12:36:40 +01:00
Eloy Lafuente (stronk7)
2ed7cc2730 Merge branch 'w10_MDL-31301_m23_textlibcleanup' of git://github.com/skodak/moodle 2012-03-06 16:06:53 +01:00
Petr Skoda
7e522ccbc8 MDL-27982 remove unsigned support from all UIs and APIs, keep only public API for BC 2012-03-06 12:02:11 +01:00
Petr Skoda
f8311defeb MDL-31301 use static textlib methods 2012-03-03 11:46:13 +01:00
Aparup Banerjee
dafa20e85c MDL-30972 Documentation : improved @see as well as added appropriate uses of inline @link. 2012-02-16 10:29:45 +08:00
Aparup Banerjee
a0eb2e97f9 MDL-30972 Documentation : Renamed DB engine drivers to "@package core" but moodle_*.php are "@subpackage dml_driver", all other dml/*.php are "@subpackage dml". 2012-02-09 10:01:42 +08:00
Aparup Banerjee
6df260107c MDL-30972 Documentation : clarified phpdocs for main public APIs in DML layer and touched up on some drivers 2012-02-09 10:01:42 +08:00
Eloy Lafuente (stronk7)
870896eca1 MDL-30147 dml - mysql and no params now behaving "standard" 2011-11-19 09:27:10 +01:00
Petr Skoda
2b0e3941e9 MDL-30026 improve session lock acquire timeouts and other minor cleanup
This is partially based on original patch by Tony Levi.
2011-11-06 17:52:15 +01:00
Eloy Lafuente (stronk7)
61e55061a6 MDL-29566 mysql - length / decimal specs in float columns are optional 2011-09-29 00:24:54 +02:00
Petr Skoda
148c65bfc8 MDL-29295 do not use strtok in dml and ddl layers
This prevents clobbering of internal pointer when code calling DML
uses strtok too. Unit test added to prevent future uses.
2011-09-14 00:19:55 +02:00
Eloy Lafuente (stronk7)
d466e23c38 MDL-28032 database - retrofit signed info for decimal/float (improves diffs detection) 2011-06-26 12:54:16 +02:00
Eloy Lafuente (stronk7)
7aa9e45f56 MDL-27325 mysql: Avoid some implicit casting from float to varchar/text 2011-05-06 16:07:17 +02:00
Petr Skoda
9e9543e54b MDL-26307 fix dbport and dbsocket support when creating mysql database 2011-02-12 20:08:49 +01:00
Petr Skoda
8c4b142cb2 MDL-26290 add experimental windows mysqli named pipe support 2011-02-06 22:11:28 +01:00
Petr Skoda
77f9f23b0f MDL-26290 make sure ini_get('mysqli.default_port') returns number 2011-02-06 21:21:23 +01:00
Petr Skoda
79ac5a8cf2 MDL-25910 add support for custom mysql socket location 2011-01-14 10:20:04 +01:00
Aparup Banerjee
bac1401534 lib MDL-25532 added dbport handling for during db creation 2010-12-09 06:18:20 +00:00
Aparup Banerjee
feaddca9e9 lib MDL-25532 added dbport option to mysqli driver 2010-12-07 07:30:35 +00:00