I installed a fresh copy mySQL-4.1alpha on XP.  I ran
it standalone as follows:

mysqld-max --standalone --console
--default-table-type=innodb

I get the same results with my script.

Since I didn't specify a character set, I assume it is
the default (ISO-8859-1) set as specified in the
Section 4.6.1 of the 4.1 manual.  I appreciate any and
all help.  For now, I am having to disable foreign key
integrity constraint checking.

Ed

--- Victoria Reznichenko
<[EMAIL PROTECTED]> wrote:
> Ed Smith <[EMAIL PROTECTED]> wrote:
> > Greetings.  When I execute the SQL script below in
> > mySQL 4.1, I get
> > 
> > ERROR 1216: Cannot add or update a child row: a
> > foreign key constraint fails
> > 
> > It is, of course, choking on the enroll row
> insert. 
> > Why is this happening?  Here are some things that
> make
> > the problem go away:
> > 
> > 1.  Take out the "name VARCHAR(30)" attribute from
> > student OR change the type to CHAR(30):  In
> Section
> > 6.5.3.1 (second bullet), it says that if one
> attribute
> > is variable length, all attributes "silently"
> become
> > variable length.  Does this mean student.sid is
> really
> > a VARCHAR?  Could this be related to the problem?
> > 
> > 2.  Change type of enroll.sid to VARCHAR(5).
> > 
> > 3.  Change "Earl" to "Early"
> > 
> > My theory:  student.sid get "silently changed"
> from
> > CHAR to VARCHAR since student.name is VARCHAR;
> > however, enroll.sid does not change because there
> are
> > no variable length fields in enroll.  This means
> that
> > 
> > enroll.sid = "Earl "
> > student.sid = "Earl"
> > 
> > Consequently, there is no match.
> > 
> > Note that I did try specifying a length for the
> index
> > on sid (i.e., "INDEX sidindex (sid(5)),") but that
> > didn't help.  Even shortening to 4 doesn't help,
> which
> > doesn't jive with my cohersion theory, assuming I
> > understand the index length specification.
> >
> 
> I tested your example and it worked fine for me. I
> didn't get any error.
> What is value of default-character-set?
> 
> 
> -- 
> For technical support contracts, goto
> https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.net
> http://www.ensita.net/
>    __  ___     ___ ____  __
>   /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
>  / /|_/ / // /\ \/ /_/ / /__  
> [EMAIL PROTECTED]
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
>        <___/   www.mysql.com
> 
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:   
>
http://lists.mysql.com/[EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to