[Ur] Bug in SQL name-mangling (patch)

Istvan Chung istvan at vivatropolis.org
Thu Apr 23 16:40:29 EDT 2015


During a compile with the latest Ur/Web release (7b508cd0dbf9), the
compiler mangled the definition [table tname] project [projectname] into
the MySQL name [uw_Projectname_tname] at one point in the binary rather
than [uw_projectname_tname], thus causing the compiled binary to fail.

Upon further investigation, it appeared that the problem was in
monoize.sml:4685, which simply prefixed "uw_" rather than calling
[Settings.mangleSql].  I've attached a patch (suitable for use with [hg
import]) which fixes this individual problem, but I'm not sure if
similar issues might exist elsewhere.  It might be nice if the compiler
used SML's type system to protect against table names being used
directly in SQL without being blessed through [mangleSql], but I suspect
that would be too large of a change to be practical.

-- 
Istvan Chung
((lambda (x)
   (list x (list (quote quote) x)))
 (quote
  (lambda (x)
    (list x (list (quote quote) x)))))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_mangle.diff
Type: text/x-patch
Size: 1130 bytes
Desc: not available
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150423/76fd1c23/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150423/76fd1c23/attachment.sig>


More information about the Ur mailing list