strict_trans_tables and null defaults

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I am using 5.0.21 community-nt and have the following in the
configuration file:


I have defined this little table:

create table my_table
(id int not null primary key auto_increment,
some_text varchar(20) not null,
other_text varchar(20) default 'aaa') type=innodb

Then I try this insert:

insert into my_table (other_text) values ('abc');

I get an error 1364(HY000) Field 'some_text' doesn't have a default

Great, this is what I expected.... Life is good, so far.
Now, if I try to get the table metadata using JConnector 3.1.13 I get
some unexplicable results.

Here's the program
public class SomeTest
    private static final String tableTypes[] =
        { "TABLE", "VIEW", "SYSTEM TABLE" };

    public static void main(String[] args) throws Exception
        Connection conn;
        Statement stmt;
        ResultSet rs;
        String[] columnNames;

        conn =

        DatabaseMetaData metadata = conn.getMetaData();
        stmt = conn.createStatement();
        rs = metadata.getColumns(null,null,"my_table","%");
        ResultSetMetaData resultMetadata = rs.getMetaData();
        int columnCount = resultMetadata.getColumnCount();
        columnNames = new String[columnCount];
        for (int i = 1; i <= columnCount; i++)
            columnNames[i - 1] = resultMetadata.getColumnName(i);
            System.out.print(columnNames[i - 1]);
            if (i < columnCount)
        while (
            for (int i = 1; i <= columnCount; i++)
                System.out.print("\"" + rs.getString(columnNames[i - 1]) + "\"");
                if (i < columnCount)
Here's what I get...


Looking at the field 'some_text', JConnector tells me that it has a
default of empty string instead of null which would be what the insert
statement would indicate.

I understand the reasoning behind assigning a 'default' value to every
field when none was specified in order not to break MyISAM

My question is
Can this functionality be changed for strct_trans_tables (perhaps
strict_all_tables as well) so that it really returns a NULL default?


Site Timeline