Well I've got some news.

It seems the problem is related with the SQL syntax used in the
mysql.sql file not being 100% compatible with mysql 4.0.24 (I'm using
MySQL 4.0.24_Debian-10ubuntu2-log from Ubuntu linux 5.10).

I'm sending a patch attached.

With that modification, all tests run fine... if I run them as root.
But if I run them as a normal user I have 2 errors:

[EMAIL PROTECTED]:~/devel/rails/trunk/activerecord$ rake test_mysql
(in /home/diego/devel/rails/trunk/activerecord)
/usr/bin/ruby1.8 -Ilib:test:test/connections/native_mysql
"/usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader.rb"
"test/base_test.rb" "test/associations_extensions_test.rb"
"test/deprecated_associations_test.rb"
"test/aaa_create_tables_test.rb" "test/ar_schema_test.rb"
"test/mixin_test.rb" "test/locking_test.rb" "test/reflection_test.rb"
"test/associations_join_model_test.rb" "test/associations_test.rb"
"test/unconnected_test.rb" "test/column_alias_test.rb"
"test/defaults_test.rb" "test/fixtures_test.rb"
"test/threaded_connections_test.rb" "test/schema_dumper_test.rb"
"test/callbacks_test.rb" "test/adapter_test.rb"
"test/readonly_test.rb" "test/pk_test.rb"
"test/class_inheritable_attributes_test.rb" "test/binary_test.rb"
"test/deprecated_finder_test.rb" "test/associations_go_eager_test.rb"
"test/migration_test.rb" "test/inheritance_test.rb"
"test/lifecycle_test.rb" "test/multiple_db_test.rb"
"test/mixin_nested_set_test.rb" "test/method_scoping_test.rb"
"test/finder_test.rb" "test/modules_test.rb"
"test/transactions_test.rb" "test/aggregations_test.rb"
"test/association_callbacks_test.rb" "test/validations_test.rb"
Using native MySQL
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake/rake_test_loader
Started
..................................................E...................................................................................................................................................................................E..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 43.050045 seconds.

  1) Error:
test_storing_in_pstore(AssociationsTest):
Errno::EPERM: Operation not permitted - /tmp/ar-pstore-association-test
    ./test/associations_test.rb:49:in `delete'
    ./test/associations_test.rb:49:in `test_storing_in_pstore'

  2) Error:
test_storing_in_pstore(DeprecatedAssociationsTest):
Errno::EACCES: Permission denied - /tmp/ar-pstore-association-test
    /usr/lib/ruby/1.8/pstore.rb:101:in `initialize'
    /usr/lib/ruby/1.8/pstore.rb:101:in `transaction'
    ./test/deprecated_associations_test.rb:304:in `test_storing_in_pstore'

705 tests, 2275 assertions, 0 failures, 2 errors
rake aborted!
Command failed with status (1): [/usr/bin/ruby1.8 -Ilib:test:test/connectio...]

(See full trace by running task with --trace)

Hopping to be useful here...

Diego

2006/2/15, Diego Algorta Casamayou <[EMAIL PROTECTED]>:
> 2006/2/14, Bob Silva <[EMAIL PROTECTED]>:
> > Are you using the Rails provided MySQL driver? Or have you installed the
> > native gem?
>
> I've tried both with same luck.
>
> I think I should first solve the problem while creating the database
> structure. I still have problems with the fk_test_has_fk table:
>
> [EMAIL PROTECTED]:~/devel/rails/trunk/activerecord$ mysql -u rails
> activerecord_unittest < test/fixtures/db_definitions/mysql.sql
> ERROR 1005 at line 194: Can't create table
> './activerecord_unittest/fk_test_has_fk.frm' (errno: 150)
> [EMAIL PROTECTED]:~/devel/rails/trunk/activerecord$
>
> I can't find this error anywhere in google relating to rails so it
> must be something in my configuration, but I don't know what.
>
> Diego
>
--- trunk/activerecord/test/fixtures/db_definitions/mysql.sql	2006-02-15 01:06:37.000000000 -0200
+++ trunk_new/activerecord/test/fixtures/db_definitions/mysql.sql	2006-02-15 00:47:21.000000000 -0200
@@ -195,7 +195,8 @@ CREATE TABLE `fk_test_has_fk` (
   `id`    INTEGER NOT NULL PRIMARY KEY,
   `fk_id` INTEGER NOT NULL,
 
-  FOREIGN KEY (`fk_id`) REFERENCES `fk_test_has_pk`(`id`)
+  KEY `fk` (`fk_id`),
+  CONSTRAINT `new_fk_constraint` FOREIGN KEY (`fk_id`) REFERENCES `fk_test_has_pk`(`id`)
 ) TYPE=InnoDB;
 
 
_______________________________________________
Rails-core mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to