[Ur] camel case for database table names

Kevin Johnson jkevinm.66 at gmail.com
Sun Jan 18 03:48:27 EST 2015


Hi Adam,

It turns out that by default, MySQL on windows is case insensitive for
table names, and case sensitive when installed in linux.  To make the MySQL
server case insensitive in linux, edit the my.cnf file and place
lower_case_table_names = 1 after the [mysqld].  Then restart mysql.  You
must first rename all the tables to use lower case--so this is best done
before you put anything in the database.

I think using all lower case table names would be recommended, so that the
code is portable from windows to linux.

But even so, if you do a "strings urblog.exe" you will find that the table
is referenced by both mixed case and lower case.  It seems like it just
checks the existence of the lower case named tables, as any data I put in
them was ignored.  It used the data from the table with the mixed case
name.  I hope that gives you a hint on where to look.  I should also note
that the urblog.sql file contained the mixed case table names.

Kevin Johnson


On Sat, Jan 17, 2015 at 6:39 PM, Adam Chlipala <adamc at csail.mit.edu> wrote:

>  Probably the underlying problem here is that MySQL is relatively
> underused and thus untested with Ur/Web!  If you compile with 'urweb
> -debug', you will see all of the SQL strings that are being used, some in
> /tmp/webapp.c.  Can you tell me the right case to use everywhere?  (I
> *think* case is at least being used consistently throughout the generated
> code, so apparently MySQL applies a case preference automatically
> somewhere.  Also, I'm pretty sure the main demo has worked with MySQL
> recently, so maybe some element of your configuration is nonstandard, e.g.
> the filesystem?)
>
>
> On 01/17/2015 02:23 PM, Kevin Johnson wrote:
>
> When I try to execute the examples from Gian Perrone's web tutorial, I get
> the following error:
>
>  Fatal initialization error: Table 'uw_urblog_comment' does not exist.
>
>  I am running mysql 5.5 on a ubuntu system.
>
>  The urblog.sql defined the table as 'uw_Urblog_comment'.
>
>  I have tried modifying the sql file to use 'uw_urblog_comment', but then
> the urblog.exe complains that 'uw_Urblog_comment' doesn't exist.
>
>  I have to have both table names in the database.  Is there perhaps an
> ignore table name case flag I am missing somewhere that everyone uses?
>
>  Thank you,
>
>  Kevin Johnson
>
>
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150118/54de04ab/attachment.html>


More information about the Ur mailing list