Commit Graph

82 Commits

Author SHA1 Message Date
Sergey Tsalkov
f7a52ca410 DATE_FORMAT() tests for %% escaping 2021-06-28 22:20:59 +00:00
Sergey Tsalkov
d944430401 drop DBHelper 2021-06-27 05:35:28 +00:00
Sergey Tsalkov
a10b76b2de cleanup some error-checking code
add lots more tests for that code
2021-06-27 03:17:47 +00:00
Sergey Tsalkov
50ed9675f3 fix pre_parse and pre_run hooks
add testing for all hooks (roll into previous ErrorTest group)
2021-06-26 00:52:37 +00:00
Sergey Tsalkov
aad5cbbbac cleanup and better test queryWalk() 2021-06-25 18:23:59 +00:00
Sergey Tsalkov
cd64dd724b add tests for queryWalk() 2021-06-25 17:35:39 +00:00
Sergey Tsalkov
15f40efe5d add DB::queryWalk() -- still untested
add DB::lastQuery() (with tests)
2021-06-24 03:05:46 +00:00
Sergey Tsalkov
50fd6ed6d2 actually bring back deprecated methods, keep them for now to maintain backwards compatability 2021-06-23 01:27:03 +00:00
Sergey Tsalkov
6487873c68 new hook-based system for inserting callbacks to run before and after a query
debugMode() now works through the new system
2021-06-22 06:01:28 +00:00
Sergey Tsalkov
bac5503d5a PHP 8 complains when trying to access closed $mysqli object, not sure how to test this properly
I don't think we need this test very much, anyway
2021-06-20 03:13:11 +00:00
Sergey Tsalkov
42894b70ae re-design query parser, new model has cleaner code and allows for %% escaping of % characters 2021-06-20 03:12:15 +00:00
Sergey Tsalkov
20c7acd8a4 DB::parse() lets you generate queries without running them 2021-06-20 02:32:56 +00:00
Sergey Tsalkov
1d2ad974f8 drop deprecated methods:
queryOneRow (alias of queryFirstRow)
queryOneList (alias of queryFirstList)
queryOneColumn
queryOneField
2021-06-20 02:32:56 +00:00
Sergey Tsalkov
7c1f9bc226 DB::$usenull is removed, it makes no sense in a modern PHP context 2021-06-20 02:32:56 +00:00
Sergey Tsalkov
dab71efacd DB::columnList() now returns details 2021-06-20 02:28:26 +00:00
Sergey Tsalkov
38545ddb3a remove more PHP 5.2 cruft, we now require PHP 5.3+ 2021-06-20 02:28:26 +00:00
Sergey Tsalkov
e8c19ca2f8 clean up update() and delete(), both will now be compatible with named and numbered arguments
resolves #54
2020-07-10 01:13:31 +00:00
Sergey Tsalkov
226a08611f small test fix to pass on PHP 7.3 2020-07-09 19:51:28 +00:00
wadih
031901f8b6 Add a warning to prevent accidents (#65) 2020-07-08 21:19:59 -05:00
Sergey Tsalkov
8e19d9d6c3 bugfix in WhereClause: negate didn't wrap multiple clauses in extra parens
Fixes #41
2017-10-15 19:10:35 +00:00
Sergey Tsalkov
67b24c916d additional test with %li0 2014-10-27 02:00:21 +00:00
Sergey Tsalkov
e0660a9368 %? no longer handles arrays and hashes for security purposes
those are moved into %l?, %ll?, %hc, %ha, %ho for different uses
2014-10-27 02:00:21 +00:00
Sergey Tsalkov
eb36858f1a columnList() properly escapes table names 2014-06-16 22:40:22 +00:00
Sergey Tsalkov
1d797b306e bugfix: insert/update type functions don't break when using a param_char other than % 2014-06-14 02:41:06 +00:00
Sergey Tsalkov
37fd169be3 minor bugfix: don't assume that the query results for queryFirstRow() or queryFirstList() will be an array (can also be a bool) 2014-06-14 00:27:38 +00:00
Sergey Tsalkov
7c5c03c576 minor cleanups 2014-06-13 21:19:10 +00:00
Sergey Tsalkov
2707bcba7d minor bugfix: don't drop identical query components in WhereClause (thanks Alexander!) 2013-12-06 11:17:54 -08:00
Sergey Tsalkov
7b0da839de add yet another test for this weird bug people are reporting
tests *still* all pass, I can't reproduce the bug
2013-11-08 14:14:46 -08:00
Sergey Tsalkov
1d51c2b674 add additional test case for a reported bug where '%s' in data is parsed as a query placeholder
I can't reproduce the bug
2013-09-13 22:36:33 -07:00
Sergey Tsalkov
740ca7bc67 restore %ss to working, add unit test so it won't break again 2013-06-21 16:27:05 -07:00
Sergey Tsalkov
e61d66fdf8 new DateTime() can be used with insert-like commands, and with %? as well 2013-06-02 19:45:44 -07:00
Sergey Tsalkov
e9a55de0b4 DB::$usenull param can be used to decide whether insert()-like commands insert NULL or empty string for NULL 2013-06-02 19:22:14 -07:00
Sergey Tsalkov
9e4cbc28c1 %t and %lt variables can be used to hold a datetime, which will be formatted to mysql standards 2013-06-02 19:10:28 -07:00
Sergey Tsalkov
e94f75fe2a DB::disconnect() allows easy disconnecting from mysql 2013-03-19 12:02:47 -07:00
Sergey Tsalkov
ce11e65070 successful insert/replace/update/delete will return true 2013-03-19 11:31:50 -07:00
Sergey Tsalkov
6cb757797b minor fix for calculated columns with fullcolumns 2013-03-19 11:20:20 -07:00
Sergey Tsalkov
027e1529ba create DB::queryFullColumns() which will supply full column names in the format table.column 2013-02-22 22:11:27 -08:00
Sergey Tsalkov
f89d70e49e bugfix: can use null value for named or numbered parameters 2013-02-22 16:32:15 -08:00
Sergey Tsalkov
6babe98b11 bugfix: free any extra results so CALL commands don't fail 2013-02-22 16:18:18 -08:00
Sergey Tsalkov
039468f3a3 more cleanups and remove old and unused code 2013-02-22 15:08:08 -08:00
Sergey Tsalkov
ed347e841a verticalslice and reindex cleanups and tests 2012-09-20 20:50:05 -07:00
Sergey Tsalkov
2ffb770f8a bugfix: don't fail when inserting multiple rows at once, and one of the values is NULL 2012-09-19 14:58:09 -07:00
Sergey Tsalkov
ed9c29fe49 add DB::transactionDepth() for checking how many transactions are active
when not using nested transactions, will return 1 or 0
2012-09-18 21:08:28 -07:00
Sergey Tsalkov
9a41bf34a1 a few nested transaction cleanups
functionality for committing/rolling back all active transactions
2012-09-18 20:54:39 -07:00
Sergey Tsalkov
d40bc57dde add nested transactions (mysql >= 5.5 only) 2012-09-18 19:08:37 -07:00
Sergey Tsalkov
c62fc187ee quick testing change 2012-09-09 17:31:57 -07:00
Sergey Tsalkov
6b324d1291 using $where is now equivalent to $where->text() 2012-09-09 14:49:43 -07:00
Sergey Tsalkov
5b4e5a959a fix named parameters 2012-07-22 17:43:34 -07:00
Sergey Tsalkov
7582961ee1 named parameters for queries 2012-07-22 17:29:59 -07:00
Sergey Tsalkov
9930fc073a restore %lb parameter to working, add unit test so it doesn't break again 2012-02-03 17:19:54 -08:00