53 Commits

Author SHA1 Message Date
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
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 Škoda
ce1f5ed57a MDL-44624 fix false failures in DML tests 2014-03-14 14:14:10 +08:00
Tim Hunt
9eec598ca9 MDL-44251 fix typo in DML unit tests. 2014-03-02 09:41:17 +01:00
David Monllao
3af7eea68d MDL-43882 dml: New test for perf_get_xxxx() methods 2014-02-21 13:21:13 +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
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
Dan Poltawski
356d33a866 MDL-42775 dml: remove invalid unit test assertion 2013-11-08 12:25:49 +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
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
d11b8d0c63 MDL-40808 remove unused DML strings 2013-07-25 12:02:29 +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
Petr Škoda
031a6de97a MDL-39038 nasty workaround for Oracle NULL concats 2013-04-08 23:23:08 +02:00
Petr Škoda
e788339786 MDL-37742 add debugging message when $DB->sql_empty() used 2013-03-26 22:12:17 +01:00
Petr Škoda
77a5c09354 MDL-37742 simplify dirty one-space oracle hack 2013-03-24 13:43:18 +01:00
Eloy Lafuente (stronk7)
5ab0371d74 Merge branch 'MDL-37854_master' of https://github.com/markn86/moodle 2013-02-05 11:10:48 +01:00
Mark Nelson
17222a4a25 MDL-37854 phpunit: replaced occurrence of non-existent function assertFail 2013-02-05 18:03:25 +08:00
Petr Škoda
dd8a39a881 MDL-37734 add one more recordset isolation test 2013-01-29 10:10:40 +01:00
Petr Škoda
b39eac3eca MDL-36983 fix incorrect test method name
Credit goes to David Scotson, thanks.
2012-12-06 15:32:15 +01:00
Petr Škoda
bc5a5527e5 MDL-35691 add unit tests for the fixed integer column length info 2012-10-06 10:07:48 +02:00
Eloy Lafuente (stronk7)
8e4f6bb1d4 MDL-34657 test: verify CASE statements in ORDER BY clauses. 2012-09-27 12:41:41 +01:00
Petr Škoda
d719d59f25 MDL-35506 add more transaction error tests 2012-09-26 10:51:03 +02:00
Petr Škoda
ee70cee844 MDL-35506 test if error in transaction forces rollback 2012-09-20 10:29:12 +02:00
Eloy Lafuente (stronk7)
742b6984fc Merge branch 'w38_MDL-35129_m24_dbmigration' of git://github.com/skodak/moodle 2012-09-18 01:12:17 +02:00
Petr Škoda
eb10d5541e MDL-35479 use new debugging asserts in dml tests 2012-09-17 11:28:56 +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
Dan Poltawski
4afbd0c834 Merge branch 'w28_MDL-34159_m24_wherelist' of git://github.com/skodak/moodle 2012-07-10 12:52:14 +08:00
Petr Skoda
63224dee44 MDL-33568 improve DB->count_records*()
Now always returns integer and invalid queries are detected.
2012-07-06 08:09:11 +02:00
Petr Škoda
7f22fb4dd9 MDL-34159 improve where_clause_list performance 2012-07-06 07:57:08 +02:00
Petr Škoda
c56cdae977 MDL-34130 prevent some warning in PHPStorm 2012-07-01 21:50:36 +02:00
Petr Škoda
3b5f6e6c2a MDL-34130 test recordset data is static
We do not want recordset results to be affected by subsequent update or delete queries.
2012-07-01 21:35:37 +02:00
Petr Škoda
4993d5fe00 MDL-34130 add missing rs close
Thanks Eloy!
2012-07-01 21:24:13 +02:00
Petr Škoda
e1defa2ed5 MDL-34130 test interaction of recordsets and transactions 2012-07-01 21:23:54 +02:00
Petr Škoda
541ca062f1 MDL-34130 test nested recordset iteration 2012-07-01 21:23:37 +02:00
Petr Škoda
401793a36d MDL-34130 fix data inserts in recordset tests 2012-07-01 21:23:21 +02:00
Petr Skoda
a6d9d4efc2 MDL-32003 fix PHP4-isms in core xmldb code 2012-06-17 22:56:29 +02:00
Petr Skoda
94417438b3 MDL-32003 fix phpdocs in xmldb abstraction 2012-06-17 22:56:28 +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
Eloy Lafuente (stronk7)
cbdcdd4734 MDL-33434 dml: define expected results when unique constraint is violated on insert. 2012-05-31 01:00:07 +02:00
Petr Skoda
ed63f7f883 MDL-32907 prevent sql_like() backslash quoting problems in PostgreSQL 2012-05-12 16:40:11 +02:00
Petr Skoda
8eaa21e195 MDL-32323 fix issues breaking phpunit tests for sqlsrv driver 2012-04-11 22:14:18 +02:00
Petr Skoda
4787e466d6 MDL-32323 make sure DDL libs are loaded before starting function db tests 2012-04-10 15:27:06 +02:00