SVN Error
|
|
I was able to point at my SVN installation no problem. The commit logs show up fine. However, when I click through to look at one of the commits, I get an error. Here’s the top, I can give more if needed:
ActionView::TemplateError (Mysql::Error: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right
syntax to use near 'change, id' at line 1:
SELECT * FROM changes WHERE (changes.changeset_id = 855)
ORDER BY change, id) on line #14 of app/views/changes/show.rhtml:
11:
12: <pre class="log"><%= h word_wrap(@change.log, 110) %></pre>
13: <div class="file_list"><ul>
14: <% @change.changes.each do |c| %>
15: <li><span class=<%= %("#{c.change}")-%>><%= c.change %></span>
16: <% if c.modified? and c.diffable? %>
17: <%= link_to c.changed, :anchor => c.changed %>
|
|
|
Hmm, I’m running on PostgreSQL. I’m guessing that is caused by this bit of code in the Changeset model:
has_many :changes, :order => 'change, id'I’m not that knowledgeable about MySQL. Can it not order by more than one column? |
|
|
I tried that syntax and it works. My next guess was that “change” is a reserved word. Sure enough: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Ouch. I’m open to suggestions. |
|
|
Hmm, have I mentioned that I hate MySQL? Perhaps |
|
|
I just checked the referenced link above—no “change_type” is listed. You don’t like MySQL because…? I’ve heard good things about Postgres, but have not actually used it yet. |
|
|
Ok, sounds good. I’ll migrate to I don’t like MySQL because they don’t care about standards. Quick and dirty or whatever else works. Today I had to rewrite SQL because I like PostgreSQL because they have been very concerned about standards from the beginning. They are ACID compliant (I wouldn’t trust that about MySQL ever). They were concerned about correctness at the start and then optimized. Over the past 8 years I’ve had almost uniformly good experiences with PostgreSQL. So, yeah, definitely check it out. I use it without pains on OS X and Ubuntu 6.06, but have also used it on Debian 3.1 and any number of Redhat distros. |
|
|
Great, I’m eager to update when the change is in. One of these days I’ll find an excuse to use PostgreSQL (and figure out how to pronounce it :-) |