First of all, I googled this question but didn't find any similar situations. So I appreсiate any help.
I have a table:
CREATE TABLE tinypurses.purses (
id SMALLINT(6) NOT NULL AUTO_INCREMENT,
Time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
keyyy CHAR(100) DEFAULT NULL,
LastSeed SMALLINT(6) NOT NULL DEFAULT 0,
PRIMARY KEY (id),
INDEX purses_id_index (id)
)
ENGINE = INNODB
AUTO_INCREMENT = 2
CHARACTER SET utf8
COLLATE utf8_general_ci;
When I try insert a new record into it, I got an error:
Database error: [MySQL][ODBC 5.1 Driver][mysqld-5.1.47-community]Column 'LastSeed' cannot be null
I'm confused because I explicitly set value for column 'LastSeed':
statement.prepare(connection(), "insert into purses (time, keyyy, LastSeed) values(?, ?, ?)");
statement.param(1).set_as_systemtime(sysTime);
statement.param(2).set_as_string(key);
statement.param(3).set_as_long(1);
if (!stmt.execute())
{
LOG << statement.last_error(); // got this error here
}
Moreover, this code works fine on Windows XP and 7, but not on Windows 8 (with the same version of MySQL server).
Does anybody have any ideas why it works on a such strange manner?
Thank you.