提交 cc7cd877 编写于 作者: M Michael Meskes

Fixed segfault in adjust_informix due to missing varchar type.

上级 89b5cbe9
......@@ -1882,6 +1882,15 @@ Mon Dec 6 21:27:34 CET 2004
- Fixed bug in parsing of typedef'ed array sizes.
- Synced parser.
Thu Dec 23 09:26:08 CET 2004
- Added PGTYPEStimestamp_add_interval written by Dave Cramer.
- Fixed parsing of defines to make sure they used more than once.
Mon Jan 10 13:55:32 CET 2005
- Fixed segfault in adjust_informix due to missing varchar type.
- Set ecpg version to 3.2.0.
- Set compat library version to 1.2.
- Set ecpg library version to 4.2.
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.302 2004/12/06 20:35:35 meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.303 2005/01/10 12:58:30 meskes Exp $ */
/* Copyright comment */
%{
......@@ -231,12 +231,12 @@ adjust_informix(struct arguments *list)
original_var = ptr->variable->name;
sprintf(temp, "%d))", ecpg_informix_var);
if ((ptr->variable->type->type != ECPGt_char && ptr->variable->type->type != ECPGt_unsigned_char) && atoi(ptr->variable->type->size) > 1)
if ((ptr->variable->type->type != ECPGt_varchar && ptr->variable->type->type != ECPGt_char && ptr->variable->type->type != ECPGt_unsigned_char) && atoi(ptr->variable->type->size) > 1)
{
ptr->variable = new_variable(cat_str(4, make_str("("), mm_strdup(ECPGtype_name(ptr->variable->type->u.element->type)), make_str(" *)(ECPG_informix_get_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type, make_str("1")), ptr->variable->type->size), 0);
sprintf(temp, "%d, (", ecpg_informix_var++);
}
else if ((ptr->variable->type->type == ECPGt_char || ptr->variable->type->type == ECPGt_unsigned_char) && atoi(ptr->variable->type->size) > 1)
else if ((ptr->variable->type->type == ECPGt_varchar || ptr->variable->type->type == ECPGt_char || ptr->variable->type->type == ECPGt_unsigned_char) && atoi(ptr->variable->type->size) > 1)
{
ptr->variable = new_variable(cat_str(4, make_str("("), mm_strdup(ECPGtype_name(ptr->variable->type->type)), make_str(" *)(ECPG_informix_get_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->variable->type->type, ptr->variable->type->size), 0);
sprintf(temp, "%d, (", ecpg_informix_var++);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册