This patch mostly cleans up white space and coding style issues. It also makes use of http://api.drupal.org/api/function/db_query_range/5 instead of db_query() and LIMIT. lastly, it fixes the use of != by using <> to make them ANSI compatible.

Comments

greggles’s picture

StatusFileSize
new5.69 KB

Thanks very mucn.

For my own testing purposes, here's a slightly modified version (using the more standard cvs diff -up method to create the file). Also, you changed

if ($term_path != $src) {
+    if ($term_path <> $src) {

Was that on purposes or just a find and replace for != that was a little too aggressive?

greggles’s picture

Status: Needs review » Fixed

Thanks again, steamedpenguin - applied to both 5.x and 6.x branches of code.

If there was a reason for changing the != to <> on that $term_path let me know and I can see about fixing it as well.

samirnassar’s picture

Sorry about that extra <> it was a mistake. I replaced a != too many.

http://drupal.org/patch/create said that diff -urp was acceptable, but I'll be happy to use something else. Does that node need to be amended?

greggles’s picture

For some reason I had to manually enter in the path to the files I was using. I'm not sure why that happened though.

Again, thanks for your help with this.

samirnassar’s picture

Odd. Perhaps the problem is that I diff -urp stock/module modified/module > module.patch ?

greggles’s picture

Status: Fixed » Needs review
StatusFileSize
new1.53 KB

I had forgotten to change one of the db_query's to db_query_range - also, the from/range arguments to db_query_range come at the end of the argument list...

Attached patch fixes these errors.

greggles’s picture

Also, my thanks to kvaderw in http://groups.drupal.org/node/10485#comment-33910 who found this.

greggles’s picture

Status: Needs review » Closed (duplicate)

So, the problem identified in #6 above caused termalias to be blank which is in #243538: Empty 'termalias' placeholder

greggles’s picture

Status: Closed (duplicate) » Active

Will the real ANSI standard please stand up?
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/pathauto/pa...

vs.

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/pathauto/pa...

Freso seems to think that it's the opposite of this patch. I don't really care which one, but I'd prefer consistency and agreement.

Freso’s picture

Status: Active » Closed (duplicate)
  1. How is fix[ing] the use of != by using <> to make them ANSI compatible the opposite of what I have done? (Ie., replacing an instance of "!=" in an SQL query with "<>".)
  2. freso@nayru ~> wget http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
    --2008-05-11 08:35:15-- http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt
    [...]
    2008-05-11 08:35:19 (444 KB/s) - `sql1992.txt' saved [1637014/1637014]
    freso@nayru ~> grep "!=" sql1992.txt
    freso@nayru ~> grep "<>" sql1992.txt
    ::= <>
    ii) "X <> Y" is true if and only if XV and YV are not equal.
    b) "x <> Ry" is true if and only if RXi <> RYi for some i.
    g) "x = Ry" is false if and only if "Rx <> Ry" is true.
    h) "x <> Ry" is false if and only if "Rx = Ry" is true.
    ( S1 = S2 AND ( T1 <> T2 OR T1 = T2 ) )
    type CHAR is array (POSITIVE range <>) of CHARACTER_
    type BIT is array (NATURAL range <>) of BOOLEAN;
    AND ( NUMERIC_SCALE <> 0 AND NUMERIC_PRECISION_
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    WHERE TABLE_TYPE <> 'VIEW' ) ),
    CHECK ( TABLE_CATALOG <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    <> ANY ( SELECT CATALOG_NAME FROM SCHEMATA )
    ( SQL_LANGUAGE_SOURCE <> 'ISO 9075' )
    WHERE FK_DEGREE <> PK_DEGREE ) )
    freso@nayru ~>

    :)

greggles’s picture

Ah, you both did the same thing...I got confused because I knew that I had "fixed" this recently, but the performance improvement patch re-introduced the old notation.