Emacs : Information and code concerning Emacs
Updated: 2/2/2004; 2:41:43 PM.

 

Subscribe to "Emacs" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Thursday, January 15, 2004

Igor Rayak reported a couple of bugs in tsql-indent.el.  His email talks about 2 indent problems:

should be :

(SELECT T.pno as pno , T.cost+C.assemblyCost as cost
 FROM CompositeParts C, (SELECT TM.pno1 as pno , ? as cost
                         FROM TempMadeFrom TM, BaseParts B
                         WHERE TM.pno2=B.pno
                         GROUP BY TM.pno1) T
 WHERE C.pno=T.pno)
 UNION
(SELECT * FROM BaseParts);


tsql-indent will give you

(       SELECT T.pno as pno , T.cost+C.assemblyCost as cost
        FROM CompositeParts C,
(       SELECT TM.pno1 as pno , ? as cost       <==
        FROM TempMadeFrom TM, BaseParts B
        WHERE TM.pno2=B.pno
        GROUP BY TM.pno1) T
        WHERE C.pno=T.pno)          <<===
        UNION                       <<===
(SELECT * FROM BaseParts);


or quite better


(       SELECT T.pno as pno , T.cost+C.assemblyCost as cost
        FROM CompositeParts C,( SELECT TM.pno1 as pno , ? as cost
                                FROM TempMadeFrom TM, BaseParts B
                                WHERE TM.pno2=B.pno
                                GROUP BY TM.pno1) T
                                WHERE C.pno=T.pno      <<== indent problem
                                )

                                UNION                  <<== indent problem
(SELECT * FROM BaseParts);

I think we have here 2 indent problem , because WHERE is belong to first
select and not to second.
and union belongs to first and third select. not to second one.

Unfortunately, I'm not able to dig in and fix these immediately.  I'm putting them on the to do list for the code.


9:34:29 AM    comment []

© Copyright 2004 Tom Pierce.



Click here to visit the Radio UserLand website.

 


January 2004
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Oct   Feb

Search

 
How this works

Emacs Sources
 tsql-indent.el
 user-add-sql-folding-marks
 remove-line-boundary-in-region
 convert-camel-to-underscore

My Subscriptions
 Funny
 KM