mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
- Fixed order mismatch in processing "using" arguments.
- Fixed some minor things in test cases. - Use defines for Informix error codes.
This commit is contained in:
@ -22,18 +22,18 @@ main()
|
||||
|
||||
value1 = PGTYPESnumeric_new();
|
||||
PGTYPESnumeric_from_int(1407, value1);
|
||||
text = PGTYPESnumeric_to_asc(value1, 0);
|
||||
text = PGTYPESnumeric_to_asc(value1, -1);
|
||||
printf("long = %s\n", text);
|
||||
|
||||
value1 = PGTYPESnumeric_from_asc("2369.7", NULL);
|
||||
value2 = PGTYPESnumeric_from_asc("10.0", NULL);
|
||||
res = PGTYPESnumeric_new();
|
||||
PGTYPESnumeric_add(value1, value2, res);
|
||||
text = PGTYPESnumeric_to_asc(res, 0);
|
||||
text = PGTYPESnumeric_to_asc(res, -1);
|
||||
printf("add = %s\n", text);
|
||||
|
||||
PGTYPESnumeric_sub(res, value2, res);
|
||||
text = PGTYPESnumeric_to_asc(res, 0);
|
||||
text = PGTYPESnumeric_to_asc(res, -1);
|
||||
printf("sub = %s\n", text);
|
||||
|
||||
PGTYPESnumeric_copy(res, &des);
|
||||
@ -45,12 +45,12 @@ main()
|
||||
exec sql select num into :des from test where text = 'test';
|
||||
|
||||
PGTYPESnumeric_mul(res, &des, res);
|
||||
text = PGTYPESnumeric_to_asc(res, 0);
|
||||
text = PGTYPESnumeric_to_asc(res, -1);
|
||||
printf("mul = %s\n", text);
|
||||
|
||||
value2 = PGTYPESnumeric_from_asc("10000", NULL);
|
||||
PGTYPESnumeric_div(res, value2, res);
|
||||
text = PGTYPESnumeric_to_asc(res, 0);
|
||||
text = PGTYPESnumeric_to_asc(res, -1);
|
||||
PGTYPESnumeric_to_double(res, &d);
|
||||
printf("div = %s %e\n", text, d);
|
||||
|
||||
|
@ -20,13 +20,13 @@ int main()
|
||||
$commit;
|
||||
|
||||
$insert into test (i, j) values (7, 2);
|
||||
printf("%ld: %s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
|
||||
printf("INSERT: %ld=%s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
|
||||
if (sqlca.sqlcode != 0) $rollback;
|
||||
|
||||
$insert into test (i, j) values (:i, 1);
|
||||
|
||||
$select i from test where j=(select j from test);
|
||||
printf("%ld: %s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
|
||||
printf("SELECT: %ld=%s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
|
||||
if (sqlca.sqlcode != 0) $rollback;
|
||||
|
||||
$declare c cursor for select * from test where i <= :i;
|
||||
@ -55,7 +55,7 @@ int main()
|
||||
deccvint(14, &m);
|
||||
decadd(&j, &m, &n);
|
||||
$delete from test where i=:n;
|
||||
printf("delete: %ld\n", sqlca.sqlcode);
|
||||
printf("DELETE: %ld\n", sqlca.sqlcode);
|
||||
|
||||
$select 1 from test where i=14;
|
||||
printf("Exists: %ld\n", sqlca.sqlcode);
|
||||
|
Reference in New Issue
Block a user