Commit e576f71f authored by Michael Meskes's avatar Michael Meskes

Fix ecpg crash with bytea and cursor variables.

Author: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
parent aa90d995
......@@ -289,7 +289,8 @@ adjust_outofscope_cursor_vars(struct cursor *cur)
else if ((ptr->variable->type->type != ECPGt_varchar
&& ptr->variable->type->type != ECPGt_char
&& ptr->variable->type->type != ECPGt_unsigned_char
&& ptr->variable->type->type != ECPGt_string)
&& ptr->variable->type->type != ECPGt_string
&& ptr->variable->type->type != ECPGt_bytea)
&& atoi(ptr->variable->type->size) > 1)
{
newvar = new_variable(cat_str(4, mm_strdup("("),
......@@ -305,7 +306,8 @@ adjust_outofscope_cursor_vars(struct cursor *cur)
else if ((ptr->variable->type->type == ECPGt_varchar
|| ptr->variable->type->type == ECPGt_char
|| ptr->variable->type->type == ECPGt_unsigned_char
|| ptr->variable->type->type == ECPGt_string)
|| ptr->variable->type->type == ECPGt_string
|| ptr->variable->type->type == ECPGt_bytea)
&& atoi(ptr->variable->type->size) > 1)
{
newvar = new_variable(cat_str(4, mm_strdup("("),
......@@ -316,7 +318,8 @@ adjust_outofscope_cursor_vars(struct cursor *cur)
ptr->variable->type->size,
ptr->variable->type->counter),
0);
if (ptr->variable->type->type == ECPGt_varchar)
if (ptr->variable->type->type == ECPGt_varchar ||
ptr->variable->type->type == ECPGt_bytea)
var_ptr = true;
}
else if (ptr->variable->type->type == ECPGt_struct
......
......@@ -51,7 +51,7 @@ main(void)
#line 27 "bytea.pgc"
struct bytea_1 { int len; char arr[ DATA_SIZE ]; } send_buf [ 2 ] ;
struct bytea_1 { int len; char arr[ 512 ]; } send_buf [ 2 ] ;
#line 28 "bytea.pgc"
struct bytea_2 { int len; char arr[ DATA_SIZE ]; } recv_buf [ 2 ] ;
......@@ -139,9 +139,9 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 68 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test values ( $1 , $2 )",
ECPGt_bytea,&(send_buf[0]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1),
ECPGt_bytea,&(send_buf[0]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_bytea,&(send_buf[1]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1),
ECPGt_bytea,&(send_buf[1]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 69 "bytea.pgc"
......@@ -161,7 +161,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
dump_binary(recv_buf[0].arr, recv_buf[0].len, ind[0]);
dump_binary(recv_short_buf.arr, recv_short_buf.len, ind[1]);
/* Test for variable length array */
/* Test for cursor */
init();
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "truncate test", ECPGt_EOIT, ECPGt_EORT);
#line 76 "bytea.pgc"
......@@ -170,32 +170,89 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 76 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test values ( $1 , $2 )",
ECPGt_bytea,&(send_buf[0]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1),
ECPGt_bytea,&(send_buf[0]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_bytea,&(send_buf[1]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1),
ECPGt_bytea,&(send_buf[1]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 77 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 77 "bytea.pgc"
ECPGset_var( 0, &( send_buf[0] ), __LINE__);\
/* declare cursor1 cursor for select data1 from test where data1 = $1 */
#line 78 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();
#line 78 "bytea.pgc"
#line 78 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cursor1 cursor for select data1 from test where data1 = $1 ",
ECPGt_bytea,&(send_buf[0]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 79 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 79 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch from cursor1", ECPGt_EOIT,
ECPGt_bytea,&(recv_buf[0]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_2),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 80 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 80 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cursor1", ECPGt_EOIT, ECPGt_EORT);
#line 81 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 81 "bytea.pgc"
{ ECPGdeallocate(__LINE__, 0, NULL, "cursor1");
#line 82 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 82 "bytea.pgc"
dump_binary(recv_buf[0].arr, recv_buf[0].len, 0);
/* Test for variable length array */
init();
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "truncate test", ECPGt_EOIT, ECPGt_EORT);
#line 87 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 87 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test values ( $1 , $2 )",
ECPGt_bytea,&(send_buf[0]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1),
ECPGt_bytea,&(send_buf[0]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_bytea,&(send_buf[1]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1),
ECPGt_bytea,&(send_buf[1]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 78 "bytea.pgc"
#line 88 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 78 "bytea.pgc"
#line 88 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test values ( $1 , $2 )",
ECPGt_bytea,&(send_buf[0]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_bytea,&(send_buf[1]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 89 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 89 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select data1 from test", ECPGt_EOIT,
ECPGt_bytea,&(recv_vlen_buf),(long)DATA_SIZE,(long)0,sizeof(struct bytea_3),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 79 "bytea.pgc"
#line 90 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 79 "bytea.pgc"
#line 90 "bytea.pgc"
dump_binary(recv_vlen_buf[0].arr, recv_vlen_buf[0].len, 0);
dump_binary(recv_vlen_buf[1].arr, recv_vlen_buf[1].len, 0);
......@@ -204,30 +261,30 @@ if (sqlca.sqlcode < 0) sqlprint();}
/* Test for dynamic sql statement with normal host variable, indicator */
init();
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "truncate test", ECPGt_EOIT, ECPGt_EORT);
#line 86 "bytea.pgc"
#line 97 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 86 "bytea.pgc"
#line 97 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "ins_stmt",
ECPGt_bytea,&(send_buf[0]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1),
ECPGt_bytea,&(send_buf[0]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_bytea,&(send_buf[1]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1),
ECPGt_bytea,&(send_buf[1]),(long)512,(long)1,sizeof(struct bytea_1),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 87 "bytea.pgc"
#line 98 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 87 "bytea.pgc"
#line 98 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "sel_stmt", ECPGt_EOIT,
ECPGt_bytea,&(recv_buf[0]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_2),
ECPGt_int,&(ind[0]),(long)1,(long)1,sizeof(int),
ECPGt_bytea,&(recv_short_buf),(long)DATA_SIZE - LACK_SIZE,(long)1,sizeof(struct bytea_4),
ECPGt_int,&(ind[1]),(long)1,(long)1,sizeof(int), ECPGt_EORT);
#line 88 "bytea.pgc"
#line 99 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 88 "bytea.pgc"
#line 99 "bytea.pgc"
dump_binary(recv_buf[0].arr, recv_buf[0].len, ind[0]);
dump_binary(recv_short_buf.arr, recv_short_buf.len, ind[1]);
......@@ -235,81 +292,81 @@ if (sqlca.sqlcode < 0) sqlprint();}
/* Test for dynamic sql statement with sql descriptor */
init();
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "truncate test", ECPGt_EOIT, ECPGt_EORT);
#line 94 "bytea.pgc"
#line 105 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 94 "bytea.pgc"
#line 105 "bytea.pgc"
{ ECPGset_desc(__LINE__, "idesc", 1,ECPGd_data,
ECPGt_bytea,&(send_buf[0]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1), ECPGd_EODT);
ECPGt_bytea,&(send_buf[0]),(long)512,(long)1,sizeof(struct bytea_1), ECPGd_EODT);
#line 95 "bytea.pgc"
#line 106 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 95 "bytea.pgc"
#line 106 "bytea.pgc"
{ ECPGset_desc(__LINE__, "idesc", 2,ECPGd_data,
ECPGt_bytea,&(send_buf[1]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_1), ECPGd_EODT);
ECPGt_bytea,&(send_buf[1]),(long)512,(long)1,sizeof(struct bytea_1), ECPGd_EODT);
#line 96 "bytea.pgc"
#line 107 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 96 "bytea.pgc"
#line 107 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "ins_stmt",
ECPGt_descriptor, "idesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 97 "bytea.pgc"
#line 108 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 97 "bytea.pgc"
#line 108 "bytea.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "sel_stmt", ECPGt_EOIT,
ECPGt_descriptor, "odesc", 1L, 1L, 1L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 98 "bytea.pgc"
#line 109 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 98 "bytea.pgc"
#line 109 "bytea.pgc"
{ ECPGget_desc(__LINE__, "odesc", 1,ECPGd_indicator,
ECPGt_int,&(ind[0]),(long)1,(long)1,sizeof(int), ECPGd_data,
ECPGt_bytea,&(recv_buf[0]),(long)DATA_SIZE,(long)1,sizeof(struct bytea_2), ECPGd_EODT);
#line 99 "bytea.pgc"
#line 110 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 99 "bytea.pgc"
#line 110 "bytea.pgc"
{ ECPGget_desc(__LINE__, "odesc", 2,ECPGd_indicator,
ECPGt_int,&(ind[1]),(long)1,(long)1,sizeof(int), ECPGd_data,
ECPGt_bytea,&(recv_short_buf),(long)DATA_SIZE - LACK_SIZE,(long)1,sizeof(struct bytea_4), ECPGd_EODT);
#line 100 "bytea.pgc"
#line 111 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 100 "bytea.pgc"
#line 111 "bytea.pgc"
dump_binary(recv_buf[0].arr, recv_buf[0].len, ind[0]);
dump_binary(recv_short_buf.arr, recv_short_buf.len, ind[1]);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table test", ECPGt_EOIT, ECPGt_EORT);
#line 104 "bytea.pgc"
#line 115 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 104 "bytea.pgc"
#line 115 "bytea.pgc"
{ ECPGtrans(__LINE__, NULL, "commit");
#line 105 "bytea.pgc"
#line 116 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 105 "bytea.pgc"
#line 116 "bytea.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");
#line 106 "bytea.pgc"
#line 117 "bytea.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 106 "bytea.pgc"
#line 117 "bytea.pgc"
return 0;
......
......@@ -3,6 +3,7 @@ len=499, ind=512, data=0xfffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e
len=512, ind=0, data=0xfffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100
len=512, ind=0, data=0xfffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100
len=512, ind=0, data=0xfffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100
len=512, ind=0, data=0xfffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100
len=499, ind=512, data=0xfffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d
len=512, ind=0, data=0xfffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100
len=499, ind=512, data=0xfffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d
......@@ -24,7 +24,7 @@ int
main(void)
{
exec sql begin declare section;
bytea send_buf[2][DATA_SIZE];
bytea send_buf[2][512];
bytea recv_buf[2][DATA_SIZE];
bytea recv_vlen_buf[][DATA_SIZE];
bytea recv_short_buf[DATA_SIZE - LACK_SIZE];
......@@ -71,6 +71,17 @@ while (0)
dump_binary(recv_buf[0].arr, recv_buf[0].len, ind[0]);
dump_binary(recv_short_buf.arr, recv_short_buf.len, ind[1]);
/* Test for cursor */
init();
exec sql truncate test;
exec sql insert into test values(:send_buf[0], :send_buf[1]);
exec sql declare cursor1 cursor for select data1 from test where data1 = :send_buf[0];
exec sql open cursor1;
exec sql fetch from cursor1 INTO :recv_buf[0];
exec sql close cursor1;
exec sql free cursor1 ;
dump_binary(recv_buf[0].arr, recv_buf[0].len, 0);
/* Test for variable length array */
init();
exec sql truncate test;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment