Commit Graph

113 Commits

Author SHA1 Message Date
tjhunt e5b7520dce MDL-16141 Need an sql_position function to do POSITION(needle IN haystack) on crappy databases. Backported from HEAD. 2008-08-20 08:51:19 +00:00
tjhunt 931d8ad7c1 MDL-14726 - rcache bit wrong in set_field 2008-05-07 13:04:42 +00:00
stronk7 78356e70e8 Backporting sql_cast_char2int() to 18_STABLE. MDL-12893 2008-04-21 18:00:24 +00:00
stronk7 c40ff3464d Modify sql_concat() to support all elements being numeric. MDL-13823 ; backported from HEAD 2008-04-20 21:20:45 +00:00
stronk7 9d88867d0f Enforce DOT as decimal separator for Oracle. MDL-11629 ; backported from HEAD 2008-04-06 15:44:48 +00:00
stronk7 fd6024c0be Fix wrong conversion from '0' to '' in oracle_diry_hack. MDL-14182 ; backported from HEAD 2008-04-04 11:27:03 +00:00
skodak c8d51449f7 MDL-13237, MDL-13661 - fixing rcache regression, sorry :-(; merged from MOODLE_19_STABLE 2008-02-25 15:16:21 +00:00
nicolasconnault 502e8e4c30 MDL-12158 Applied Matt's patch, merging from 1.7 2008-02-05 10:38:44 +00:00
skodak a8cd1b57da MDL-13237 rceche limiting through intcachemax finally implemented - this should prevent major memory leaks; backported from MOODLE_19_STABLE 2008-01-29 17:52:11 +00:00
poltawski 6b3eca01f2 MDL-12882 - we were caching empty records which caused clone warnings
backported from MOODLE_19_STABLE
2008-01-08 20:21:30 +00:00
martinlanghoff e54510d166 dmllib:rcache_set()/rcache_get() - use clone() function which we can support in PHP4 - MDL-12827 2008-01-08 04:15:48 +00:00
nicolasconnault 737b745890 MDL-12827 Saving a clone of the $record in the cache instead of the record itself, to avoid referencing 2008-01-04 09:23:35 +00:00
stronk7 0196475e23 Adding some outer spaces to returned SQL to avoid wrong
sentences caused by concatenation.
2007-12-03 20:41:31 +00:00
stronk7 8245849ef9 Adding two new functions: sql_isempty() and sql_isnotempty() to perform
SQL comparisons to empties in a cross-db way. General solution for
problems like MDL-12084
2007-12-03 20:08:07 +00:00
martinlanghoff 2b33092aba Revert - dmllib: check $MCACHE->status() before using it 2007-09-20 06:46:35 +00:00
martinlanghoff b874e680dc dmllib: check $MCACHE->status() before using it 2007-09-20 06:41:32 +00:00
stronk7 daf3c36c51 MSSQL blobs doesn't like quoted binaries. MDL-9835 2007-08-10 00:55:44 +00:00
stronk7 dda4bbbf25 Fixed insert/update of Oracle xLOBs. Credit goes to Rita Scholes. MDL-9835 2007-08-09 18:16:47 +00:00
stronk7 273c8bf204 $dataobject in insert_record() and update_record() must be objects.
Added code to detect, fix and debug array situations. Related to MDL-9751.
2007-08-05 22:35:31 +00:00
stronk7 1027fcce3b Fixing typo causing purge of accelerator cache not working. MDL-9349 2007-04-15 11:10:42 +00:00
sam_marshall 5c33b48580 Undoing previous commit, which happened by accident - apologies 2007-03-28 17:13:17 +00:00
sam_marshall 993f282295 Improved performance status (bug 2924) 2007-03-28 16:58:34 +00:00
skodak 3ab00a0f6d fixed warning with undefined rcache during install 2007-01-30 09:11:19 +00:00
stronk7 d3fca5cba8 nothing interesting, just a comment. 2007-01-30 00:22:21 +00:00
stronk7 1e15c0fdad Added Oracle DIRTY HACK to both rs_fetchXX functions.
Detecting of EOF in rs_fetch_record()
Big improvement of rs_fetch_next_record() by using FethRow()
with speeds near native fields[]. MDL-8134

Merged from MOODLE_17_STABLE
2007-01-28 23:15:16 +00:00
stronk7 d9e10456ba Initial commit of the new rs_XXX() functions to fetch, advance and close
ADOdb recordsets in a standard way. Not finished yet but I need them in CVS.
MDL-8134

Merged from MOODLE_17_STABLE
2007-01-28 20:14:09 +00:00
stronk7 3e7dab97e7 And finally I've found the annoying bug that was causing Oracle to
execute strange SQL statements! Argh! Now I can go to sleep...
2007-01-28 01:07:52 +00:00
stronk7 ad88038fdb Fixing silly (like me) typo. 2007-01-27 23:39:57 +00:00
stronk7 358b1e9359 Oracle PL/SQL blocks can end by ";". Prevent that to be trimmed. 2007-01-27 23:37:22 +00:00
stronk7 db21b7a28c Adding two helper functions and modify upgrade to
work properly under MSSQL and Oracle. MDL-8303

Added one simple hack to execute_sql() in order
to avoid and debug about trailing ;
2007-01-26 21:27:44 +00:00
martinlanghoff bb931a61c6 rcache: cleanup, upgrade path, config options (MDL-8163)
record cache and caching schemes get a little cleanup, faster
if()s and a nice set of config options. Users who've been using
the internal cache get a nice upgrade too.
2007-01-14 23:02:13 +00:00
stronk7 1d5c40048a Moving set_dbfamily() from dmllib.php to setuplib.php as it's
needed in early stages and we don't want the installer to
depend of dmllib.
2007-01-13 10:44:58 +00:00
stronk7 da340978d5 Need to return the value too, to use it sometimes. 2007-01-13 00:07:40 +00:00
stronk7 d847d4027b Now set_dbfamily() will work properly when invoked from install. 2007-01-12 23:52:23 +00:00
stronk7 c672870f8e Introducing CFG->dbfamily and create a setter function for it
(to be able to use families at install). MDL-7061
2007-01-12 23:44:00 +00:00
stronk7 82372b2c64 Introducing iPhone support for Moodle. B-)
Nah, just introducing $CFG->dbfamily. MDL-7061 :-D
2007-01-10 16:31:40 +00:00
martinlanghoff 02d3b34a8e rcache_getforfill() - better phpdoc 2006-12-27 22:55:12 +00:00
martinlanghoff 3530015874 rcache functions -- use a saner memory cache API
Push into the $MCACHE object
 - dealing with getforfill() nuances
 - dealing with moodle-host prefixes
2006-12-27 22:46:31 +00:00
martinlanghoff ec9fe5cf6f rcache_set() and rcache_table_unset(): use a configurable TTL 2006-12-27 22:45:47 +00:00
martinlanghoff c96a4a46d5 rcache_* calls - flesh out logic and use $MCACHE if available
- move from $CFG->enablerecordcache <count> to $CFG->rcache <type>

 - if $CFG->rcache === 'internal' use the cache array
   otherwise, attempt to use $MCACHE

 - implement and use rcache_getforfill() to catch thundering herds

 - the cache lifetime is hardcoded to 2s until we understand better the
   possible race conditions against updates that are not happening via
   update_record() / delete_record()
2006-12-27 22:40:38 +00:00
martinlanghoff 6c2f585f85 dmllib: introducing the rcache_* functions for record cache handling
Abstracted Sam's initial work with $record_cache into a series of functions
that abstract things _just enough_ that we can use an internal
in-memory-array implementation or something that is shared across
processes, like memcached or the turckmmcache/eaccelerator caches.

Also
- added hit/miss stats tracking and reporting
- removed max entries limiting as it was buggy - var names mismatches
  and not counting unset()s
2006-12-27 22:39:32 +00:00
sam_marshall ad9947a857 MDL-7969 Documented requirement for first column in get_records_sql etc to be a unique field such as id. 2006-12-18 13:54:31 +00:00
tjhunt 0dae5d33a7 MDL-7926 - set_field_select function. Merged from MOODLE_17_STABLE. 2006-12-15 18:23:31 +00:00
stronk7 c54f0c106a Prevent some false-positives detecting uses of old user_XXX tables.
See http://moodle.org/mod/forum/discuss.php?d=58976

Merged from MOODLE_17_STABLE
2006-11-18 20:28:00 +00:00
skodak 810944af7f we are going 100% unicode now - removed use of $CFG->unicodedb and current_charset(); MDL-7439 - part 2, only hotpot and wiki left 2006-11-11 17:23:20 +00:00
stronk7 3eda2b3a7e modify_database() will show the deprecated debugging after 2006101007
(Moodle 1.7 release version) MDL-5919
2006-11-05 09:45:19 +00:00
stronk7 6c279afaef Now all the get_records() functions support only one field
to be specified in the SELECT clause. Not needed anymore to
write double "SELECT id, id..." queries. Results returned
follow exactly the same structure than normal recordsets
(first field = key) MDL-5877

Merged from MOODLE_17_STABLE
2006-11-04 17:01:34 +00:00
stronk7 bb5b7329bb Deprecating modify_database(). It shows debugging info
if release > 2006101004 (Beta2 +01) MDL-5919

Merged from MOODLE_17_STABLE
2006-11-04 16:22:49 +00:00
sam_marshall 2af5513789 MDL-7346 Changed enablerecordcache to be a limit for the size of cache, not just an on/off switch. 2006-11-03 17:29:15 +00:00
stronk7 6df56bc473 Oracle optimization. Texts under 4000cc can be handled directly as varchar2,
so they don't need the 2-phase (insert/update) handling of LOBs

Merged from MOODLE_17_STABLE
2006-10-30 23:13:48 +00:00