| 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.
|