Error message when adding new patient

jklompje wrote on Saturday, February 01, 2014:

Openemr 4.1.2; Mac 10.9.

When adding a new patient the error below comes up very time, although the patient is added correctly.
ERROR: insert failed: insert into history_data set pid = ?, date = NOW()

Error: Table ‘openemr.history_data’ doesn’t exist

Any ideas?

yehster wrote on Saturday, February 01, 2014:

You need to reinstall because that table doesn’t get created if strict mode is turned on during the setup process.

anonymous wrote on Saturday, February 01, 2014:

Have you done a recent upgrade? Sounds like you may have missed the sql patch.

Edit: Kevin definitely knows what he’s talking about. I’d take his advice before mine. :slight_smile:

yehster wrote on Saturday, February 01, 2014:

When table creation and other statements are run during the install process, if they fail for some reason (like strict mode being enabled), no error messages are generated.

Turning strict mode off, after installation is not sufficient to correct this issue as several tables aren’t created because they try to set a default value for “TEXT” columns which is disallowed in strict mode, including history_data. A number of insert statements for entries in the codes table also fail.

jklompje wrote on Sunday, February 02, 2014:

Thanks Kevin. It worked. I did not realize that after turning off strict mode, one had to reinstall. When I checked after your answer was posted, it was obvious as several tables were not created. Thanks again.