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

Commit89d6f68

Browse files
author
Hiroshi Inoue
committed
Add *Int8 As* option.
1 parent5206957 commit89d6f68

24 files changed

+1084
-697
lines changed

‎src/interfaces/odbc/connection.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ CC_conninfo_init(ConnInfo *conninfo)
240240
conninfo->allow_keyset=-1;
241241
conninfo->lf_conversion=-1;
242242
conninfo->true_is_minus1=-1;
243+
conninfo->int8_as=-101;
243244
memcpy(&(conninfo->drivers),&globals,sizeof(globals));
244245
}
245246
/*
@@ -298,6 +299,7 @@ CC_Constructor()
298299
rv->client_encoding=NULL;
299300
rv->server_encoding=NULL;
300301
#endif/* MULTIBYTE */
302+
rv->current_schema=NULL;
301303

302304

303305
/* Initialize statement options to defaults */
@@ -503,6 +505,9 @@ CC_cleanup(ConnectionClass *self)
503505
free(self->server_encoding);
504506
self->server_encoding=NULL;
505507
#endif/* MULTIBYTE */
508+
if (self->current_schema)
509+
free(self->current_schema);
510+
self->current_schema=NULL;
506511
/* Free cached table info */
507512
if (self->col_info)
508513
{
@@ -513,6 +518,8 @@ CC_cleanup(ConnectionClass *self)
513518
if (self->col_info[i]->result)/* Free the SQLColumns result structure */
514519
QR_Destructor(self->col_info[i]->result);
515520

521+
if (self->col_info[i]->schema)
522+
free(self->col_info[i]->schema);
516523
free(self->col_info[i]);
517524
}
518525
free(self->col_info);
@@ -986,6 +993,9 @@ CC_connect(ConnectionClass *self, char do_password)
986993
}
987994
}
988995
}
996+
#else
997+
{
998+
}
989999
#endif/* UNICODE_SUPPORT */
9901000
}
9911001
#ifdefUNICODE_SUPPORT
@@ -2046,6 +2056,27 @@ CC_get_max_query_len(const ConnectionClass *conn)
20462056
returnvalue;
20472057
}
20482058

2059+
/*
2060+
*This deosn't really return the CURRENT SCHEMA
2061+
*but there's no alternative.
2062+
*/
2063+
constchar*
2064+
CC_get_current_schema(ConnectionClass*conn)
2065+
{
2066+
if (!conn->current_schema&&conn->schema_support)
2067+
{
2068+
QResultClass*res;
2069+
2070+
if (res=CC_send_query(conn,"select current_schema()",NULL,CLEAR_RESULT_ON_ABORT),res)
2071+
{
2072+
if (QR_get_num_total_tuples(res)==1)
2073+
conn->current_schema=strdup(QR_get_value_backend_row(res,0,0));
2074+
QR_Destructor(res);
2075+
}
2076+
}
2077+
return (constchar*)conn->current_schema;
2078+
}
2079+
20492080
int
20502081
CC_send_cancel_request(constConnectionClass*conn)
20512082
{

‎src/interfaces/odbc/connection.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ typedef struct
170170
charupdatable_cursors;
171171
charlf_conversion;
172172
chartrue_is_minus1;
173+
charint8_as;
173174
GLOBAL_VALUESdrivers;/* moved from driver's option */
174175
}ConnInfo;
175176

@@ -219,6 +220,7 @@ typedef struct
219220
structcol_info
220221
{
221222
QResultClass*result;
223+
char*schema;
222224
charname[MAX_TABLE_LEN+1];
223225
};
224226

@@ -298,6 +300,7 @@ struct ConnectionClass_
298300
intbe_pid;/* pid returned by backend */
299301
intbe_key;/* auth code needed to send cancel */
300302
UInt4isolation;
303+
char*current_schema;
301304
};
302305

303306

@@ -343,6 +346,7 @@ intCC_send_cancel_request(const ConnectionClass *conn);
343346
voidCC_on_commit(ConnectionClass*conn);
344347
voidCC_on_abort(ConnectionClass*conn,UDWORDopt);
345348
voidProcessRollback(ConnectionClass*conn,BOOLundo);
349+
constchar*CC_get_current_schema(ConnectionClass*conn);
346350

347351
/* CC_send_query options */
348352
#defineCLEAR_RESULT_ON_ABORT1L

‎src/interfaces/odbc/convert.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
497497
*/
498498
bZone= FALSE;/* time zone stuff is unreliable */
499499
timestamp2stime(value,&st,&bZone,&zone);
500-
inolog("2stime fr=%d\n",st.fr);
501500
}
502501
else
503502
{
@@ -1096,7 +1095,6 @@ inolog("2stime fr=%d\n", st.fr);
10961095

10971096
caseSQL_C_ULONG:
10981097
len=4;
1099-
inolog("rgb=%x + %d, pcb=%x, set %s\n",rgbValue,bind_row*bind_size,pcbValue,neut_str);
11001098
if (bind_size>0)
11011099
*(UDWORD*) ((char*)rgbValue+ (bind_row*bind_size))=atol(neut_str);
11021100
else

‎src/interfaces/odbc/descriptor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Comments:See "notice.txt" for copyright and license information.
77
*
8-
* $Id: descriptor.h,v 1.5 2002/05/22 05:51:03 inoue Exp $
8+
* $Id: descriptor.h,v 1.6 2002/06/06 04:50:47 inoue Exp $
99
*
1010
*/
1111

@@ -41,6 +41,7 @@ typedef struct
4141
chardot[MAX_TABLE_LEN+1];
4242
charname[MAX_COLUMN_LEN+1];
4343
charalias[MAX_COLUMN_LEN+1];
44+
char*schema;
4445
}FIELD_INFO;
4546
Int4FI_precision(constFIELD_INFO*);
4647
Int4FI_scale(constFIELD_INFO*);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp