4993b76407224371d54cc890697baedfd793b501 kent Fri Mar 14 11:19:51 2014 -0700 Correcting -defaultZero behavior on fixed size char arrays. diff --git src/hg/autoSql/autoSql.c src/hg/autoSql/autoSql.c index d996f9e..1b5514f 100644 --- src/hg/autoSql/autoSql.c +++ src/hg/autoSql/autoSql.c @@ -67,31 +67,33 @@ struct dyString *type = asColumnToSqlType(col); fprintf(f, "%s", type->string); if (col->autoIncrement) { fprintf(f, " auto_increment"); } else { if (!withNull) { if (defaultZeros) { char *defaultVal = ""; if (!col->isList && !col->isArray) { - if (col->lowType->stringy) + if (col->lowType->type == t_char && col->fixedSize != 0) + defaultVal = " default ''"; + else if (col->lowType->stringy) { if (col->lowType->type == t_string) defaultVal = " default ''"; } else defaultVal = " default 0"; } fprintf(f, "%s", defaultVal); } else fprintf(f, " not null"); } } fputc(',', f); fprintf(f, "\t# %s\n", col->comment);