JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-2996

Migration step with create_table with string column with :default => "" fails due to missing default value in SQL

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Fedora Linux 9, Sun Java 1.6.0_06, JRuby 1.1.4, AR-JDBC 0.8.2
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      A test case is attached to this issue.

      [uwe@pippin activerecord-jdbc]$ rake test_derby
      (in /home/uwe/workspace/aifudis/activerecord-jdbc)
      You really need Hoe installed to be able to package this gem
      Loaded suite /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader
      Started
      ....E.................
      Finished in 6.455585 seconds.

      1) Error:
      test_create_table_column_quoting_vs_keywords(DerbyQuotingTest):
      ActiveRecord::StatementInvalid: ActiveRecord::ActiveRecordError: Syntax error: Encountered "NOT" at line 1, column 114.: CREATE TABLE dummies (id int generated by default as identity NOT NULL PRIMARY KEY, "year" varchar(256) DEFAULT NOT NULL)
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:147:in `log'
      /home/uwe/workspace/aifudis/activerecord-jdbc/lib/active_record/connection_adapters/jdbc_adapter.rb:537:in `execute'
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:108:in `create_table'
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/migration.rb:346:in `method_missing'
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/migration.rb:326:in `say_with_time'
      /usr/local/jruby-1.1.4/lib/ruby/1.8/benchmark.rb:293:in `measure'
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/migration.rb:326:in `say_with_time'
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/migration.rb:342:in `method_missing'
      /home/uwe/workspace/aifudis/activerecord-jdbc/./test/derby_migration_test.rb:6:in `up'
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/migration.rb:280:in `migrate'
      /usr/local/jruby-1.1.4/lib/ruby/1.8/benchmark.rb:293:in `measure'
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/migration.rb:280:in `migrate'
      /usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/migration.rb:263:in `up_with_benchmarks'
      /home/uwe/workspace/aifudis/activerecord-jdbc/./test/derby_migration_test.rb:18:in `test_create_table_column_quoting_vs_keywords'

      22 tests, 34 assertions, 0 failures, 1 errors
      rake aborted!
      Command failed with status (1): [/usr/local/jruby-1.1.4/bin/jruby -Ilib:tes...]

      (See full trace by running task with --trace)
      [uwe@pippin activerecord-jdbc]$

      1. ar-jdbc.diff
        2 kB
        Uwe Kubosch
      2. derby_migration_test.rb
        0.4 kB
        Uwe Kubosch

        Activity

        Hide
        Uwe Kubosch added a comment -

        Found and fixed a bug in JdbcDerbySpec.java that treated all column types as symbols while they can come as strings as well.

        Patch attached.

        Show
        Uwe Kubosch added a comment - Found and fixed a bug in JdbcDerbySpec.java that treated all column types as symbols while they can come as strings as well. Patch attached.
        Hide
        Thomas E Enebo added a comment -

        Fixed in commit c288adb. I did the patch differently than the one supplied for the quoting bit. All other issues in the patch have been previously fixed already.

        Show
        Thomas E Enebo added a comment - Fixed in commit c288adb. I did the patch differently than the one supplied for the quoting bit. All other issues in the patch have been previously fixed already.

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Uwe Kubosch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: