# \[retry\] fixture\_references: "Mysql::Error #HY000"? (fwd)

**URL:** <https://www.ruby-forum.com/t/retry-fixture-references-mysql-error-hy000-fwd/109245>\
**Category:** Rails\
**Created:** [July 12, 2007, 5:45pm UTC](https://www.ruby-forum.com/t/retry-fixture-references-mysql-error-hy000-fwd/109245 "2007-07-12T17:45:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugh\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/d2c977/32.png) [@Hugh\_S](https://www.ruby-forum.com/u/Hugh_S)\
**Post date:** [July 12, 2007, 5:45pm UTC](https://www.ruby-forum.com/t/retry-fixture-references-mysql-error-hy000-fwd/109245/1 "2007-07-12T17:45:38Z")

</div>

I’m resending this with additional information, as I’ve had no  
response. I’ve been trying to use the fixture\_references plugin,  
and I seem to be getting lots of:

1. Error:  
test\_truth(DeviceTest):  
ActiveRecord::StatementInvalid: Mysql::Error: #HY000Field  
‘description\_id’ doesn  
‘t have a default value: INSERT INTO devices (`id`) VALUES (2)  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/connection  
\_adapters/abstract\_adapter.rb:128:in `log' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection _adapters/mysql_adapter.rb:243:in `execute’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/fixtures.r  
b:290:in `insert_fixtures' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fixtures.r b:289:in `each’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/fixtures.r  
b:289:in `insert_fixtures' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fixtures.r b:257:in `create\_fixtures\_without\_references’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/fixtures.r  
b:257:in `each' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fixtures.r b:257:in `create\_fixtures\_without\_references’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/connection  
\_adapters/abstract/database\_statements.rb:59:in `transaction' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fixtures.r b:255:in `create\_fixtures\_without\_references’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:86  
7:in `silence' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fixtures.r b:248:in `create\_fixtures\_without\_references’  
/home/hgs/aeg\_intranet/csestore/config/…/vendor/plugins/fixture\_references/  
lib/fixture\_references.rb:92:in `create_fixtures' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fixtures.r b:593:in `load\_fixtures’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/fixtures.r  
b:538:in `setup’

But AFAICS the fixture data looks OK

# Read about fixtures at [http://ar.rubyonrails.org/classes/Fixtures.html](http://ar.rubyonrails.org/classes/Fixtures.html)

\<%  
fixtures :devices, :descriptions  
%\>  
olympus400\_in:  
id: 1  
description\_id: \<%= descriptions(:C\_400, ‘id’) %\>  
serialno: 238553902  
barcode: 16301  
state: ‘in stock’  
categorypath: ‘Still Picture Camera’  
lock\_version: 1

and I tried the old form  
description\_id: \<%= descriptions(:C\_400)[‘id’] %\>

but get the same error. The data does exist in the descriptions table:

C\_400:  
:text: Olympus C-400 Zoom  
🆔 7  
:picture: “”

What is puzzling me is that 1) I don’t assume a default, 2) MySQL error  
numbers are normally purely numeric, and google maps this HY000 to many  
things…

Any idea what I should be looking at for this, please? This is  
rails 1.2.3 under cygwin.

Since posting this the first time I’ve tried to find out how to get  
more information out of the system using the script/console, to no  
avail.

The test database has no data in it prior to the tests, and without  
assuming Active Record is happy, I don’t know how to query it once the  
fixtures are in place (if their insertion succeeded).

```
    Thank you,
    Hugh

```
