Open-AudIT
https://www.open-audit.org/phpBB3/

Alpha 2 MySQL Strict mode
https://www.open-audit.org/phpBB3/viewtopic.php?f=20&t=3629
Page 1 of 1

Author:  jpa [ Wed Apr 28, 2010 4:23 am ]
Post subject:  Alpha 2 MySQL Strict mode

I've installed Alpha2 and run in to some issues with data insert. I'm getting "data truncated" and "incorrect integer value" errors when OpenAudit tries insert audit data. I think this is because my MySQL config has strict-mode set to something other than '' which means 'traditional MySQL-mode'. The OpenAudit insert code is inserting blank values ('') for integers and enums and expecting MySQL to convert to zero.

I'm not familiar enough with the CodeIgniter framework to figure out where to insert a [code]SET sql_mode = '';
[/code]
call for the OpenAudit database session. I can change my MySQL config later to see if this is actually the problem.

Author:  jpa [ Wed Apr 28, 2010 4:27 am ]
Post subject:  Re: Alpha 2 MySQL Strict mode

Also database related. The system.serial field is too short (50) to hold a VMware machine's serial number.

Author:  Mark [ Thu Apr 29, 2010 9:45 pm ]
Post subject:  Re: Alpha 2 MySQL Strict mode

I've not heard of the data being truncated.
Any help you can provide on thiat would be most appreciated.

Have increased the serial and man_serial fields to 200 characters in length.

Author:  jpa [ Fri Apr 30, 2010 1:25 am ]
Post subject:  Re: Alpha 2 MySQL Strict mode

The data truncated error came from saving '' to a "yes,no" enum field. When MySQL is in strict mode you can't store '' or NULL in an enum. The incorrect integer value error comes from trying to store '' in an integer. [url=http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html]Strict mode[/url] makes you do more work but is more portable. You can set a sesson variable to put OpenAudit's database session in traditional mode so a default strict server mode doesn't cause these problems. I don't know where it goes in the CodeIgniter framework.

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/