SVN Error

Subscribe to SVN Error 7 posts, 2 voices

 
Avatar Jamie Orchar... 13 posts

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 %>
 
Avatar brixen 20 posts 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?
 
Avatar Jamie Orchar... 13 posts

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.

 
Avatar brixen 20 posts

Hmm, have I mentioned that I hate MySQL?

Perhaps change_type? If you assure me that’s not a MySQL reserved word, I’ll change alter fix it or whatever.

 
Avatar Jamie Orchar... 13 posts

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.

 
Avatar brixen 20 posts

Ok, sounds good. I’ll migrate to change_type.

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 IS isn’t an operator until 5.0.1.

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.

 
Avatar Jamie Orchar... 13 posts

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 :-)