Re: H2 / MySql compatibility improvement

73 views
Skip to first unread message

edmund

unread,
Jun 22, 2012, 2:33:39 AM6/22/12
to h2-da...@googlegroups.com
Hi,
I checked the h2 source and used the attached patch to get a second mysql profile "MySQLNullCheck" in which the insertZeroForNull flag is not set.
works for me but doesnt comply with the weird behavior of mysql.

Hope this helps other trying to use h2/mysql for testing...

Best,
Edmund

On Thursday, June 21, 2012 5:35:12 PM UTC+2, edmund wrote:
Hi,

i stubled over a inconsistent behavior of mysql and h2/mysql:

consider a table product with tiltle and desc both definded as not null.

an insert like this will work in mysql and h2/mysql (as metioned in the compatiblity doc):
> INSERT INTO `product` (`description`) VALUES ( 'asdf' );

but this one should fail with some sql error just like in mysql:
> INSERT INTO `product` (`title`,`description`) VALUES (NULL, 'asdf' );

A Hint where I might change that in h2 would be nice :)

Best,
Edmund

edmund

unread,
Jun 22, 2012, 2:37:52 AM6/22/12
to h2-da...@googlegroups.com
missed the patch..
Sorry noscript ;)
MySQLNullCheck.patch

Thomas Mueller

unread,
Nov 18, 2013, 4:50:28 AM11/18/13
to H2 Google Group
Hi,

I would like to avoid adding a new compatibility mode. Instead, I think it would be better to match the MySQL behavior... I didn't know it was wrong, until I read the first answer of this question: http://stackoverflow.com/questions/20013154/h2-does-not-enforce-not-null-in-mysql-compatibility-mode

Patches are welcome!

Regards,
Thomas




--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/HlY6awFfkXUJ.

To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Reply all
Reply to author
Forward
0 new messages