Skip to: content | sidebar | login

Null values in DBA

Posted on 2007-08-24 05:38:01 CEST.

Did you notice unexpected segfaults or luckily, did you find something like "(process:10725): GLib-CRITICAL **: g_ascii_strtod: assertion `nptr != NULL' failed" in your error log? If so, please doublecheck your table definitions.

As we all know, Midgard provides a great interface that allows connect external tables so that records could be treated as native Midgard objects. It is called MgdSchema.

In few words all you have to do is create MgdSchema file and reload Apache. But be careful. If your schema file defines a property like:

<property name='testprop' type='integer' />

and your table field defines it like:

'testprop' int(11) null,

most probably you will face subject problem. It is all because Midgard core cannot assign int variable a null value. So if you want to spare some sleepless nigths just verify the way tables are built and convert all 'null' fields to 'not null default 0' or whatever value is ambient for your datatype.

Another side effect is that records with null values sometimes are not published as results into a MidgardQuerybuilder object and again, if you are missing some results in QB - check your tables.

Back


Return to top