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

Commit40eb549

Browse files
author
Hiroshi Inoue
committed
1) Fix a bug in declare/fetch mode.
2) Suppress some error logs for the request to other drivers.
1 parent50b5d4b commit40eb549

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

‎src/interfaces/odbc/environ.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ PGAPI_StmtError(HSTMT hstmt,
281281
caseSTMT_INVALID_OPTION_IDENTIFIER:
282282
strcpy(szSqlState,"HY092");
283283
break;
284+
caseSTMT_OPTION_NOT_FOR_THE_DRIVER:
285+
strcpy(szSqlState,"HYC00");
286+
break;
284287
caseSTMT_EXEC_ERROR:
285288
default:
286289
strcpy(szSqlState,"S1000");

‎src/interfaces/odbc/options.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,19 @@ set_statement_option(ConnectionClass *conn,
209209
conn->stmtOptions.use_bookmarks=vParam;
210210
break;
211211

212+
case1227:
213+
case1228:
214+
if (stmt)
215+
{
216+
stmt->errornumber=STMT_OPTION_NOT_FOR_THE_DRIVER;
217+
stmt->errormsg="The option may be for MS SQL Server(Set)";
218+
}
219+
elseif (conn)
220+
{
221+
conn->errornumber=STMT_OPTION_NOT_FOR_THE_DRIVER;
222+
conn->errormsg="The option may be for MS SQL Server(Set)";
223+
}
224+
returnSQL_ERROR;
212225
default:
213226
{
214227
charoption[64];

‎src/interfaces/odbc/qresult.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ struct QResultClass_
102102

103103
/* status macros */
104104
#defineQR_command_successful(self)( !(self->status == PGRES_BAD_RESPONSE || self->status == PGRES_NONFATAL_ERROR || self->status == PGRES_FATAL_ERROR))
105+
#defineQR_command_maybe_successful(self) ( !(self->status == PGRES_BAD_RESPONSE || self->status == PGRES_FATAL_ERROR))
105106
#defineQR_command_nonfatal(self)( self->status == PGRES_NONFATAL_ERROR)
106107
#defineQR_end_tuples(self)( self->status == PGRES_END_TUPLES)
107108
#defineQR_set_status(self,condition)( self->status = condition )

‎src/interfaces/odbc/results.c‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ inolog("COLUMN_NULLABLE=%d\n", value);
628628
break;
629629

630630
caseSQL_COLUMN_OWNER_NAME:/* == SQL_DESC_SCHEMA_NAME */
631-
p="";
631+
p=fi&& (fi->ti) ?fi->ti->schema :"";
632632
break;
633633

634634
caseSQL_COLUMN_PRECISION:/* in 2.x */
@@ -744,6 +744,10 @@ inolog("COLUMN_TYPE=%d\n", value);
744744
value= (fi&& !fi->name[0]&& !fi->alias[0]) ?SQL_UNNAMED :SQL_NAMED;
745745
break;
746746
#endif/* ODBCVER */
747+
case1212:
748+
stmt->errornumber=STMT_OPTION_NOT_FOR_THE_DRIVER;
749+
stmt->errormsg="this request may be for MS SQL Server";
750+
returnSQL_ERROR;
747751
default:
748752
stmt->errornumber=STMT_INVALID_OPTION_IDENTIFIER;
749753
stmt->errormsg="ColAttribute for this type not implemented yet";
@@ -1293,9 +1297,10 @@ PGAPI_ExtendedFetch(
12931297

12941298
/* increment the base row in the tuple cache */
12951299
QR_set_rowset_size(res,opts->rowset_size);
1296-
/* QR_inc_base(res, stmt->last_fetch_count); */
1297-
/* Is inc_base right ? */
1298-
res->base=stmt->rowset_start;
1300+
if (SC_is_fetchcursor(stmt))
1301+
QR_inc_base(res,stmt->last_fetch_count);
1302+
else
1303+
res->base=stmt->rowset_start;
12991304

13001305
/* Physical Row advancement occurs for each row fetched below */
13011306

‎src/interfaces/odbc/statement.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ typedef enum
7979
#defineSTMT_RETURN_NULL_WITHOUT_INDICATOR29
8080
#defineSTMT_ERROR_IN_ROW30
8181
#defineSTMT_INVALID_DESCRIPTOR_IDENTIFIER31
82+
#defineSTMT_OPTION_NOT_FOR_THE_DRIVER32
8283

8384
/* statement types */
8485
enum

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp