This project is archived and is in readonly mode.

#3517 ✓stale
Arun Kumar Arjunan

Make MysqlAdapter.table_exists? to respect the mysql configuation lower_case_table_names

Reported by Arun Kumar Arjunan | November 29th, 2009 @ 08:56 AM

MysqlAdapter.table_exists? method doesn't work well when mysql is configured with lower_case_table_names = 1 in my.cnf.

This causes the following code to fail when running the command rake test on the rails branch from the second time onwards.

rails/activerecord/test/schema.rb

  create_table "CamelCase", :force => true do |t| t.string :name ;  end

Reason: Since, we are passing the :force option to the create_table method, it will try to first drop the table if exists. But table_exists?('CamelCase') will return false though we already have the table created when we ran the test for the first time. As it returned false, we directly create the table without even dropping it. This will raise the 'Table already exists' excpetion.

Comments and changes to this ticket

  • Rohit Arondekar

    Rohit Arondekar October 6th, 2010 @ 06:28 AM

    • State changed from “new” to “stale”
    • Importance changed from “” to “”

    Marking ticket as stale. If this is still an issue please make a comment with suggested changes, creating a patch with tests, or rebasing an existing patch or just confirming the issue on latest releases/master.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Tags

Pages