Commit Graph

38 Commits (c56c5b41793eea279aed941ad49fab3c62842976)

Author SHA1 Message Date
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
Dries Buytaert 92d0f3e602 - Patch #82137 by havran: make installer work with PostgreSQL. 2006-09-04 14:50:24 +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 81938a3cdc #76802: Introduce placeholder magic into t()
See: http://drupal.org/node/64279#t-placeholders
2006-08-18 12:17:00 +00:00
Dries Buytaert 885a29c4cd - Patch #39382 by smsimms / sammys et al: make PostgreSQL password optional. 2006-08-18 08:41:49 +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
Gerhard Killesreiter 70aae83c8e #58166, fixes for typos, patch by Uwe Herrmann 2006-04-11 11:33:15 +00:00
Dries Buytaert 2823cec45e - Patch #51392 by smsimms: fixed typo in help text. 2006-02-26 19:48:43 +00:00
Dries Buytaert b1bdd4ac54 - Patch #41870 by fgm: improved debugging support. 2006-02-20 16:46:59 +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 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 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 67f7d6947e - Fixed bug #19868: undefined variable. 2005-04-08 11:24:46 +00:00
Dries Buytaert 61783651ed - Patch #15254: removed hardcoded 'public' schema from the PostgreSQL backend. 2005-01-07 19:18:05 +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 228b3c7cc8 - Patch #10945 by Adrian: more PostgreSQL fixes/updates. 2004-09-20 17:58:14 +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