Commit Graph

62 Commits (adc7f023c54c30c2e95c8848b4e9c3393dbfeb8f)

Author SHA1 Message Date
Dries Buytaert bd2527a4ed - Patch #98059 by chx: trying to get the never-ending regex mess right. 2006-11-21 19:46:10 +00:00
Neil Drumm 1a7bac90e7 #76819 by smsimms and sammys. Move part of the sql rewriting down into the database abstraction layer and add extra rewriting needed only for Postgres. 2006-10-23 18:38:45 +00:00
Dries Buytaert e2ed7b8eef - Patch #88705 by profix898 and sammys: made version checking work with PostgreSQL. (Critical bug) 2006-10-22 16:46:41 +00:00
Dries Buytaert 845ff1c17f - Patch #85123 by gerd: set proper HTTP headers. 2006-09-26 14:09:05 +00:00
Neil Drumm a28ee0cceb #81332 by wundo and davemicc. Allow empty MySQL passwords to work. 2006-09-16 19:26:22 +00:00
Dries Buytaert 4ea672bfd1 - Removing stray whitspaces. 2006-09-07 08:05:31 +00:00
Steven Wittens dd4f143df6 #75002: Install-time and run-time requirements checking + status report page 2006-09-01 08:44:53 +00:00
Steven Wittens 90acf99341 #75264: Redirect uninstalled default Drupal site to install.php 2006-07-31 19:24:16 +00:00
Neil Drumm b14a622103 #74997 by dww, add db_table_exists() 2006-07-26 07:16:08 +00:00
Dries Buytaert 1c75a210bd - Patch #68926 by chx, jeremy, steven, eaton, webchick, amazon, neil, nedjo et al: an initial install system for Drupal core. 2006-07-13 13:14:25 +00:00
Gerhard Killesreiter 369c776c4c SQL abstraction layer improvement. 2006-05-24 20:46:56 +00:00
Steven Wittens ca9293b3ee #54981: calls to db_lock_table in bootstrap.inc do not use db_prefix 2006-04-27 20:38:49 +00:00
Dries Buytaert b1bdd4ac54 - Patch #41870 by fgm: improved debugging support. 2006-02-20 16:46:59 +00:00
Steven Wittens d96be836c1 - #40515: MySQL UTF-8 conversion fixes 2006-02-02 01:27:57 +00:00
Dries Buytaert ba0219e403 - Patch #21719 by rkerr: made db passwords with special characters work. 2006-01-24 08:29:33 +00:00
Steven Wittens 7914ad0f3f - #40515: Ensure UTF-8 character set on the database side (and include upgrade path for incorrectly set up databases) 2006-01-21 01:42:52 +00:00
Dries Buytaert 3342593eac - Patch #38889 by rkerr: db_error and db_affected_rows did not work properly in presence of multiple database connections. 2005-12-07 15:17:27 +00:00
Dries Buytaert a19acb219e - Patch #35924 by Neil: improved the update system. 2005-12-06 09:25:22 +00:00
Dries Buytaert f8b90f6262 - Patch #39357 by m3vrck: fixed typo in mysqli backend. 2005-11-30 16:47:34 +00:00
Dries Buytaert 2d0df351d7 - Various fixes. Updated CHANGELOG.txt 2005-11-29 20:17:10 +00:00
Dries Buytaert 244945365d - Patch #10407 by Cvbge: fixed cache problems with PostgreSQL. 2005-11-27 11:52:08 +00:00
Steven Wittens 17205b6e62 #36352: Don't prefix temporary table names after all.
#36658: Make search query pgsql compatible.
2005-11-21 15:55:17 +00:00
Steven Wittens 2ad97f0277 - #36255: Fix db_query_temporary() in pgsql
- Prefix temporary table names (helps on restricted hosts)
2005-11-04 13:02:51 +00:00
Steven Wittens 278e2dd309 - Add maintenance-page error screens when the php module for the dbtype is not loaded (just showed a blank screen before) 2005-10-20 21:30:50 +00:00
Steven Wittens 909d6928ac - #28159: Advanced search features (hello from DrupalCon)
Presentation about it:
http://www.acko.net/files/drupal-search-slim.pdf
2005-10-18 14:41:27 +00:00
Dries Buytaert d3211f014d - Modified patch #13180/#29414: use mysql_real_escape_string() to escape
strings rather than addslashes().  mysql_real_escape_string() uses the
  connections charset settings to properly escape.
2005-10-13 10:23:17 +00:00
Dries Buytaert 75fad91cf5 - Patch #22911 by Cvgbe: fixed table locking in PostgreSQL. You'll have to
use db_lock_table() and db_unlock_tables() for your code to be compatible.
2005-08-29 19:32:55 +00:00
Dries Buytaert 7b8a409675 - Patch #29385 by chx: no ?> add end of files. 2005-08-25 21:14:17 +00:00
Dries Buytaert 31741b2c99 - Patch #25522 by Cvbge: _db_query() does not return FALSE in case of errors as stated in documentation. 2005-08-11 13:51:07 +00:00
Steven Wittens 897aae3e31 - #27846: Clean up dev_query code in db_query() 2005-07-30 18:01:51 +00:00
Steven Wittens d9d4b9bdab - #27231: Friendly DB error screens. 2005-07-27 01:58:43 +00:00
Dries Buytaert 5c8843704c - Patch #18213 by chx: boostrap system. Modified to work with HEAD, tidied
up the documentation a little.

  chx: can you double-check whether the global $conf variable is secure?
       (That is, make sure it can't be send using the URL or something.)
2005-06-22 20:19:58 +00:00
Dries Buytaert 7dcb9086f8 - Patch #23465 by Gerhard: tiny performance improvement to db_query_range(). 2005-05-23 21:14:01 +00:00
Dries Buytaert f2d200f51e - Patch #19442 by chx: cache_set sometimes failed.
TODO: this patch lets us clean up more code in code!  Let's have a look
        at this ...
2005-05-12 14:36:43 +00:00
Dries Buytaert fa40f24460 - Patch #20235 by chx: fixed problem with db_set_active(). 2005-04-14 18:50:16 +00:00
Dries Buytaert 29337ad8bb - Patch #13581 by Steven: Db_query() allows a variable amount of parameters so you can pass the query arguments in. There is however an alternative syntax: instead of passing the query arguments as function arguments, you can also pass a single array with the query arguments in it. For example the following two statements are equivalent:
db_query($query, $a, $b, $c);
db_query($query, array($a, $b, $c));

This usage is particularly interesting when the query is constructed dynamically, and the amount of arguments to pass varies. In that case we use the second method to avoid using call_user_func_array(). This behaviour is not documented explicitly, but it is used in several places.

However, db_query_range() and pager_query() do not support this syntax properly, which means there are several pieces of code which still revert to the ugly call_user_func_array() call.

This patch updates db_query_range() and pager_query() so they support the array-passing method. I also added documentation about this method to each of the db functions.

I also cleaned up the code for db_query (it was weird and hard to understand) and moved db_query() and db_queryd() from database.xxxxx.inc to database.inc: it was the same between both mysql and pgsql, as it doesn't do anything database specific. It just prefixes the tables and inserts the arguments. The actual db query is performed in _db_query(), which is still in database.xxxxx.inc.

Finally, I updated several places with the new syntax, and the code is a lot cleaner. For example:
- array_unshift($params, "SELECT u.* FROM {users} u WHERE $query u.status < 3");
- $params[] = 0;
- $params[] = 1;
- $result = call_user_func_array('db_query_range', $params);
+ $result = db_query_range("SELECT u.* FROM {users} u WHERE $query u.status < 3", $params, 0, 1);

and

- return call_user_func_array('db_query_range', array_merge(array($query), $args, array((int)$pager_from_array[$element], (int)$limit)));
+ return db_query_range($query, $args, (int)$pager_from_array[$element], (int)$limit);

I've tested it on mysql. I didn't alter the actual db behaviour, so pgsql should be okay too.

This patch is important because many people avoid the call_user_func_array() method and put data directly into the db query.  This is very, very bad because the database prefix will be applied to it, and strip out braces. It's also generally bad form as you have to call check_query() yourself.  With the new, documented syntax, there is no more excuse to put data directly in the query.
2004-11-29 13:13:29 +00:00
Dries Buytaert fa97839088 - Patch 13180 by chx: renamed check_query() to db_escape_string() and implemtented it properly per database backend.
Read the manual for pg_escape_string:  "Use of this function is recommended instead of addslashes()." Or read sqlite_escape_string: "addslashes() should NOT be used to quote your strings for SQLite queries; it will lead to strange results when retrieving your data."
2004-11-21 08:25:17 +00:00
Dries Buytaert b84b6e42cf - Patch #10663 by JonBob: documentation improvements: fixed some typos and improved consistency to the use of Doxygen/api.module commands in the comments. 2004-09-09 05:51:08 +00:00
Dries Buytaert 7b716e8e77 - Patch #10622 by Adrian: fixes various PostgreSQL related problems.
1) Menu problems with Postgres (this is a highly critical 1 line fix)
  2) Archive module fails with Postgres
  3) Postgres setup problems - changes to database.pgsql (although i made these changes myself before finding this patch)
  4) Book module fails with Postgres
  5) Postgres problems following creation of a new type of user - which is actually about a taxonomy.module bug.
  6) Creating accregator_item_table in PostgreSQL
  7) Postgres - Polls not displayed on Poll Page
  8) Blog module has sql errors with postgres

  This should not affect MySQL users (hopefully).
2004-09-08 15:38:26 +00:00
Dries Buytaert 63a327db97 - Patch #9287 by JonBob: made the code style in the three database include files consistent with Drupal standards, and adds a wealth of Doxygen-style comments to aid developers in writing solid database access code using the API. 2004-07-14 19:15:25 +00:00
Dries Buytaert e4d45aaef3 - Patch by Adrian: added support for multiple database connections. 2004-04-30 05:12:46 +00:00
Dries Buytaert 3904790e03 - Tidied up the DoxyGen comments. Patch by Kjartan. 2003-12-08 06:32:19 +00:00
Dries Buytaert 06045ff7fc Patch by Ax to fixe and improve to the core doxygen PHPdoc:
* fixes all doxygen warnings [#]_ in the current code base
    + changes @param style from phpDocumentor (@param type $var desc) to doxygen (@param $var desc)
    + documents all undocumented parameters
    + escapes / fixes html warnings
    + fixes @defgroup in theme.inc
  * adds more groupings [#]_
    + drupal_{set|get}_title, drupal_{set|get}_breadcrumb
    + pager.inc: pager_api (pager_query(), pager_display()), pager pieces
  * adds a new group "themeable" which contains all themeable functions.
2003-11-24 22:46:03 +00:00
Dries Buytaert 742410aafd - Bugfix: prefix not prepended to sequences. Fixes bug #3639.
Make sure to write:

    db_next_id({table}_field);

  instead of:

    db_next_id(table_field);
2003-10-22 13:03:32 +00:00
Dries Buytaert c39562ae03 - Fixed node_save() and user_save() bug introduced by table prefix changes.
Modified patches from Gerhard.

- Changed the order of the checks in node_teaser().  Patch from Kobus.
2003-07-21 15:36:05 +00:00
Dries Buytaert 337b3c9de9 - Committed a slightly modified version of Slavica's table prefix patch. 2003-07-10 17:46:44 +00:00
Dries Buytaert a161110a6b - Applied Michael Caerwyn's "%s -> %d" patch.
- Changed all occurences of '%d' to %d as suggested on the mailing list.
2003-05-07 21:00:36 +00:00
Dries Buytaert cb2d27c78d - Patch by Ax. Fixed some syntax errors:
-    case t("whatever");
    +    case t("whatever"):
2003-04-04 06:17:02 +00:00
Dries Buytaert 3ab5709af5 - Changed pconnect() to connect(). 2003-04-03 22:18:47 +00:00
Dries Buytaert b2583b624c Patch by Ax:
- db_query_range() in database.mysql.inc wasn't updated to match
  db_query().

- Fixed phpdoc.
2003-03-16 17:38:51 +00:00