remove_column from migration seem broken on SQL Server 2000 #368

Closed
pschambacher opened this Issue Apr 9, 2013 · 5 comments

Comments

Projects
None yet
2 participants
Contributor

pschambacher commented Apr 9, 2013

I'll try to investigate later. It pops an error about a missing column in a system table.
I don't have the stack trace anymore, will add it when working on fixing it.

Contributor

pschambacher commented Apr 9, 2013

OK here is the stack trace:

ActiveRecord::JDBCError: table: sysobjects does not exist: SELECT d.name FROM sysobjects d, syscolumns c, sysobjects t WHERE c.cdefault = d.id AND c.name = 'name' AND t.name = 'runners' AND c.id = t.idarjdbc/jdbc/RubyJdbcConnection.java:568:in `columns'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/jdbc/adapter.rb:234:in `jdbc_columns'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/mssql/adapter.rb:528:in `columns'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/mssql/adapter.rb:670:in `special_column_names'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/mssql/adapter.rb:658:in `repair_special_columns'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/mssql/adapter.rb:637:in `do_exec_query'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/mssql/adapter.rb:629:in `_execute'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/jdbc/adapter.rb:296:in `execute'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/jdbc/adapter.rb:296:in `execute'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/jdbc/adapter.rb:319:in `select'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/jdbc/adapter.rb:324:in `select_rows'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/mssql/adapter.rb:476:in `remove_default_constraint'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/mssql/adapter.rb:462:in `remove_column'
org/jruby/RubyArray.java:1613:in `each'
C:/dev/repos/activerecord-jdbc-adapter/lib/arjdbc/mssql/adapter.rb:460:in `remove_column'

The issue is that if I copy this query and paste it in SQL Server Management Studio, it just works ... this might actually be a problem of access right or something on my side ...

Owner

kares commented Apr 9, 2013

I really do not have a SQL Server 2000 ... maybe if you could reproduce it I can run it against 2012 and see if it happens

Contributor

pschambacher commented Apr 9, 2013

No it's only 2000 specific. My working environment is 2005 but our production is 2000 and it only happens there.
We're going to migrate to 2012 this year but in the meantime I'll have to fix this.

I've had a look at this part of the source code and it's in a if sql_server2000? condition so it's really specific to this old dinosaur. I'll try to fix it myself but as I said, it does not happen using Management Studio ... I fear the table might not be accessible through the JDBC connection or something like it.

Anyway the issue is there to have a trace of what's going on.

Owner

kares commented Apr 9, 2013

I see OK thanks a lot for explaining (and reporting) ... I'd be happy to put in a fix for 2000 if you submit one.

Owner

kares commented Sep 25, 2013

I'm assuming this is fine now ... let us know if it ain't ... likely fixed by 3d18f64

kares closed this Sep 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment