This is a split version of previous patch: http://drupal.org/node/178555. It is not necessary to maintenance similar codes for query + argument pre-processing among 3 different functions. This patch keep db_query_range() and db_query_temporary() as a simple query builder, and left those pre-processing for db_query(). Similar query builder logic should also able to employ in INSERT/UPDATE/DELETE abstraction for D7, with the help of PDO. No harm to performance based on previous founding. Should be trivial to commit.

Comments

hswong3i’s picture

This patch is now tested for both MySQL 5.0.32 and PostgreSQL 8.1.9 on Debian etch 4.0r1 with PHP 5.2.0-8+etch7, all passed for search module (search by using db_query_temporary() + db_query_range() in display). Should really trivial to commit, without performance impact but simplify coding style for maintenance.

hswong3i’s picture

StatusFileSize
new4.76 KB

Patch reroll via latest CVS HEAD, with cvs diff.

moshe weitzman’s picture

Version: 6.x-dev » 7.x-dev

seems like a good idea .. we are past fiddling with the DB API for D6. changing version.

hswong3i’s picture

My truth position about this issue is: it is useful when I am working with D7 research, without introducing a lot of duplicated handling... It seems to be a fiddling issue, but it also seems fantastic for me if we need to postpone it (as it don't change any core logic, actually...) Anyway, the open of D7-dev shouldn't far from today... I guess so...

chx’s picture

Version: 7.x-dev » 6.x-dev

Moshe, this does not affect the DB API if I am not mistaken, only the implementation.

hswong3i’s picture

@chx: thank you for your kindly support. I guess we are still not too late for refining DB API if possible, would you mind to give a hand about this simple issue, so we won't need to keep it in record for D7?

P.S. maybe a bit off-topic... as we are now refining DB API as perfect as possible for D6, the following DB API cleanup issues may give some help to your current progress, so speeding up our development and simplify maintenance difficulties. Would you mind to give me some help, too?
http://drupal.org/node/183902
http://drupal.org/node/183892
http://drupal.org/node/183896

hswong3i’s picture

Title: Simplify db_query_range() and db_query_temporary() handling » code cleanup: simplify db_query_range() and db_query_temporary() handling
hswong3i’s picture

Status: Needs review » Closed (won't fix)

Nothing will happened even without this cleanup. Don't waste time in here.