Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f66fd8

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parent60bb92a commit6f66fd8

File tree

6 files changed

+267
-23
lines changed

6 files changed

+267
-23
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ Mon Feb 22 19:47:45 CET 1999
472472

473473
- Added 'at <db_connection>' option to all commands it is apllicable
474474
to. Due to changing the API of some libecpg functions this
475-
requires me to increase the major version number.
475+
requires me to increase the major version number of libecpg.
476476
- Synced pgc.l with scan.l.
477477
- Added support for unions.
478478

@@ -498,5 +498,9 @@ Thu Mar 4 19:49:28 CET 1999
498498
- Switched memory allocation to calloc() to make sure memory is
499499
cleared.
500500
- Fixed varchar auto-allocating.
501+
502+
Sat Mar 6 14:06:07 CET 1999
503+
504+
- Replaced placeholder ';;' by '?' since this is what standard says.
501505
- Set library version to 3.0.0
502-
- Set ecpg version to3.0.0
506+
- Set ecpg version to2.6.0

‎src/interfaces/ecpg/lib/ecpglib.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ register_error(long code, char *fmt,...)
129129
staticstructconnection*
130130
get_connection(constchar*connection_name)
131131
{
132-
structconnection*con=all_connections;;
132+
structconnection*con=all_connections;
133133

134134
if (connection_name==NULL||strcmp(connection_name,"CURRENT")==0)
135135
returnactual_connection;
@@ -377,11 +377,11 @@ next_insert(char *text)
377377
char*ptr=text;
378378
boolstring= false;
379379

380-
for (;ptr[1]!='\0'&& (ptr[0]!=';'||ptr[1]!=';'||string);ptr++)
381-
if (ptr[0]=='\'')
380+
for (;*ptr!='\0'&& (*ptr!='?'||string);ptr++)
381+
if (*ptr=='\'')
382382
string=string ? false : true;
383383

384-
return (ptr[1]=='\0') ?NULL :ptr;
384+
return (*ptr=='\0') ?NULL :ptr;
385385
}
386386

387387
staticbool
@@ -604,7 +604,7 @@ ECPGexecute(struct statement * stmt)
604604
strcat(newcopy,
605605
copiedquery
606606
+ (p-newcopy)
607-
+sizeof(";;")-1/* don't count the '\0' */);
607+
+sizeof("?")-1/* don't count the '\0' */);
608608
}
609609

610610
/*
@@ -675,7 +675,7 @@ ECPGexecute(struct statement * stmt)
675675
{
676676
ECPGlog("ECPGexecute line %d: Incorrect number of matches: %d\n",
677677
stmt->lineno,ntuples);
678-
register_error(ECPG_NOT_FOUND,"Data not found line %d.",stmt->lineno);
678+
register_error(ECPG_NOT_FOUND,"No data found line %d.",stmt->lineno);
679679
status= false;
680680
break;
681681
}
@@ -1266,8 +1266,8 @@ replace_variables(char *text)
12661266

12671267
if (!string&&*ptr==':')
12681268
{
1269-
ptr[0]=ptr[1]=';';
1270-
for (ptr+=2;*ptr&&isvarchar(*ptr);ptr++)
1269+
*ptr='?';
1270+
for (++ptr;*ptr&&isvarchar(*ptr);ptr++)
12711271
*ptr=' ';
12721272
}
12731273
}
@@ -1307,7 +1307,7 @@ ECPGprepare(int lineno, char *name, char *variable)
13071307
stmt->command=ecpg_strdup(variable,lineno);
13081308
stmt->inlist=stmt->outlist=NULL;
13091309

1310-
/* if we have C variables in our statment replace them with ';;' */
1310+
/* if we have C variables in our statment replace them with '?' */
13111311
replace_variables(stmt->command);
13121312

13131313
/* add prepared statement to our list */

‎src/interfaces/ecpg/preproc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
SRCDIR= ../../..
22
include$(SRCDIR)/Makefile.global
33

4-
MAJOR_VERSION=3
5-
MINOR_VERSION=0
4+
MAJOR_VERSION=2
5+
MINOR_VERSION=6
66
PATCHLEVEL=0
77

88
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION)\

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ user_group_clause: IN GROUP user_group_list{ $$ = cat2_str(make1_str("in group
10971097
|/*EMPTY*/{$$ = make1_str(""); }
10981098
;
10991099

1100-
user_valid_clause:VALIDUNTILSconst{$$ = cat2_str(make1_str("valid until"),$3);; }
1100+
user_valid_clause:VALIDUNTILSconst{$$ = cat2_str(make1_str("valid until"),$3); }
11011101
|/*EMPTY*/{$$ = make1_str(""); }
11021102
;
11031103

@@ -2221,7 +2221,7 @@ set_opt: SETOF{ $$ = make1_str("setof"); }
22212221

22222222
RemoveStmt:DROPremove_typename
22232223
{
2224-
$$ = cat3_str(make1_str("drop"),$2,$3);;
2224+
$$ = cat3_str(make1_str("drop"),$2,$3);
22252225
}
22262226
;
22272227

@@ -2931,7 +2931,7 @@ opt_select_limit: LIMIT select_limit_value ',' select_offset_value
29312931
|LIMITselect_limit_valueOFFSETselect_offset_value
29322932
{$$ = cat4_str(make1_str("limit"),$2, make1_str("offset"),$4); }
29332933
|LIMITselect_limit_value
2934-
{$$ = cat2_str(make1_str("limit"),$2);; }
2934+
{$$ = cat2_str(make1_str("limit"),$2); }
29352935
|OFFSETselect_offset_valueLIMITselect_limit_value
29362936
{$$ = cat4_str(make1_str("offset"),$2, make1_str("limit"),$4); }
29372937
|OFFSETselect_offset_value
@@ -3835,7 +3835,7 @@ a_expr: attr opt_indirection
38353835
|case_expr
38363836
{$$ =$1; }
38373837
|cinputvariable
3838-
{$$ = make1_str(";;"); }
3838+
{$$ = make1_str("?"); }
38393839
;
38403840

38413841
/* Restricted expressions
@@ -3982,7 +3982,7 @@ extract_list: extract_arg FROM a_expr
39823982
|/* EMPTY*/
39833983
{$$ = make1_str(""); }
39843984
|cinputvariable
3985-
{$$ = make1_str(";;"); }
3985+
{$$ = make1_str("?"); }
39863986
;
39873987

39883988
extract_arg:datetime{$$ =$1; }
@@ -4734,7 +4734,7 @@ ECPGCursorStmt: DECLARE name opt_cursor CURSOR FOR ident cursor_clause
47344734
this->next = cur;
47354735
this->name =$2;
47364736
this->connection = connection;
4737-
this->command = cat5_str(make1_str("declare"), mm_strdup($2),$3, make1_str("cursor for;;"),$7);
4737+
this->command = cat5_str(make1_str("declare"), mm_strdup($2),$3, make1_str("cursor for?"),$7);
47384738
this->argsresult =NULL;
47394739

47404740
thisquery->type = &ecpg_query;
@@ -5037,7 +5037,7 @@ ECPGExecute : EXECUTE SQL_IMMEDIATE execstring
50375037

50385038
add_variable(&argsinsert, thisquery, &no_indicator);
50395039

5040-
$$ = make1_str(";;");
5040+
$$ = make1_str("?");
50415041
}
50425042
|EXECUTEident
50435043
{
@@ -5052,7 +5052,7 @@ ECPGExecute : EXECUTE SQL_IMMEDIATE execstring
50525052
add_variable(&argsinsert, thisquery, &no_indicator);
50535053
}opt_using
50545054
{
5055-
$$ = make1_str(";;");
5055+
$$ = make1_str("?");
50565056
}
50575057

50585058
execstring:char_variable|
@@ -5860,7 +5860,7 @@ cinputvariable : cvariable indicator {
58605860

58615861
civariableonly :cvariable {
58625862
add_variable(&argsinsert, find_variable($1), &no_indicator);
5863-
$$ = make1_str(";;");
5863+
$$ = make1_str("?");
58645864
}
58655865

58665866
cvariable:CVARIABLE{$$ =$1; }

‎src/interfaces/ecpg/test/test1.pgc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ exec sql end declare section;
6363
printf("Inserted %d tuples via execute immediate\n", sqlca.sqlerrd[2]);
6464

6565
strcpy(msg, "execute insert 4");
66-
sprintf(command, "insert into test(name, amount, letter) select name, amount+;;, letter from test");
66+
sprintf(command, "insert into test(name, amount, letter) select name, amount+?, letter from test");
6767
exec sql prepare I from :command;
6868
exec sql at pm execute I using :increment;
6969

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp