For Programmers: Free Programming Magazines  


Home > Archive > Smalltalk > October 2004 > VWNC 7.2.1: Store: Bug in SQLBroker









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author VWNC 7.2.1: Store: Bug in SQLBroker
Carl Mascott

2004-10-08, 3:58 pm

While working on Store for Sybase I accidentally unmasked a latent bug in
SQLBroker class>>createDatabaseTableColumnsFor:keyNames:

The incorrect code is:

aStream nextPutAll: ', '; cr].
aKeyCollection isEmpty
ifTrue:
[aStream skip: -2.
aStream nextPut: $ .].

The correct code is:

aStream nextPutAll: ', '; cr].
aKeyCollection isEmpty
ifTrue:
[aStream skip: -3.
aStream nextPut: $ .].

This is latent because every current Store table has at least one key, so the
incorrect code is never executed.

At one time during development I defined a table with no keys. The trailing
comma didn't get overwritten and PostgreSQL 7.3.2 coughed up a parse error on
the CREATE TABLE. (Sybase 11.9.2 wasn't bothered by the trailing comma.)


--
Carl Mascott
cmascott_del_this@att.net
If replying by e-mail please correct my address.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com