Skip to content

Instantly share code, notes, and snippets.

View tskenb's full-sized avatar

Ken Been tskenb

View GitHub Profile
@tskenb
tskenb / tds_fdw-rawvalues.patch
Created October 22, 2015 13:40
Bypass conversion to string and back for many common types
diff --git a/include/tds_fdw.h b/include/tds_fdw.h
index 22a32b6..02ddbce 100644
--- a/include/tds_fdw.h
+++ b/include/tds_fdw.h
@@ -22,10 +22,21 @@
/* a column */
+typedef union COL_VALUE
+{
@tskenb
tskenb / tds_fdw-bigtable.patch
Created October 1, 2015 14:01
Estimate num rows as double instead of int
diff --git a/include/tds_fdw.h b/include/tds_fdw.h
index 40254f3..22a32b6 100644
--- a/include/tds_fdw.h
+++ b/include/tds_fdw.h
@@ -70,10 +70,10 @@ FdwPlan* tdsPlanForeignScan(Oid foreigntableid, PlannerInfo *root, RelOptInfo *b
/* Helper functions */
int tdsSetupConnection(TdsFdwOptionSet* option_set, LOGINREC *login, DBPROCESS **dbproc);
-int tdsGetRowCount(TdsFdwOptionSet* option_set, LOGINREC *login, DBPROCESS *dbproc);
-int tdsGetRowCountShowPlanAll(TdsFdwOptionSet* option_set, LOGINREC *login, DBPROCESS *dbproc);
@tskenb
tskenb / tds_fdw-trailing-spaces.patch
Created October 1, 2015 13:14
Don't remove trailing spaces
diff --git a/src/tds_fdw.c b/src/tds_fdw.c
index 7976c3b..64b6a0c 100644
--- a/src/tds_fdw.c
+++ b/src/tds_fdw.c
@@ -989,7 +989,7 @@ char* tdsConvertToCString(DBPROCESS* dbproc, int srctype, const BYTE* src, DBINT
case SYBVARCHAR:
case SYBTEXT:
real_destlen = srclen + 1; /* the size of the array */
- destlen = -1; /* the size to pass to dbconvert (-1 means to null terminate it) */
+ destlen = -2; /* the size to pass to dbconvert (-2 means to null terminate it) */
@tskenb
tskenb / postgres_log-20150918.2
Created September 18, 2015 21:13
tds_fdw issue 29 log file for proposal to revert changes fd5b441 and 8f15569
LOG: database system was shut down at 2015-09-18 20:59:57 UTC
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
Showing memory statistics before row 1.
ExecutorState: 8192 total in 1 blocks; 2744 free (2 chunks); 5448 used
printtup: 0 total in 0 blocks; 0 free (0 chunks); 0 used
tds_fdw data: 8192 total in 1 blocks; 8112 free (0 chunks); 80 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
Showing memory statistics after row 1.
ExecutorState: 8192 total in 1 blocks; 2744 free (2 chunks); 5448 used
@tskenb
tskenb / postgres_log.5b78ee7
Created September 18, 2015 18:33
tds_fdw issue 29 log file for commit 5b78ee7
LOG: database system was shut down at 2015-09-18 12:40:50 UTC
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
Showing memory statistics before row 1.
ExecutorState: 8192 total in 1 blocks; 2744 free (2 chunks); 5448 used
printtup: 0 total in 0 blocks; 0 free (0 chunks); 0 used
tds_fdw data: 8192 total in 1 blocks; 8112 free (0 chunks); 80 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
Showing memory statistics after row 1.
ExecutorState: 8192 total in 1 blocks; 2744 free (2 chunks); 5448 used
@tskenb
tskenb / postgres_log.8f15569
Created September 17, 2015 13:26
tds_fdw issue 29 log file for commit 8f15569
LOG: database system was shut down at 2015-09-17 13:02:15 UTC
LOG: autovacuum launcher started
LOG: database system is ready to accept connections
Showing memory statistics before row 1.
ExecutorState: 8192 total in 1 blocks; 2744 free (2 chunks); 5448 used
printtup: 0 total in 0 blocks; 0 free (0 chunks); 0 used
tds_fdw data: 8192 total in 1 blocks; 8112 free (0 chunks); 80 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
Showing memory statistics after row 1.
ExecutorState: 8192 total in 1 blocks; 2744 free (2 chunks); 5448 used
@tskenb
tskenb / postgres_log.2b09f99
Created September 16, 2015 15:19
tds_fdw issue 29 log file for commit 2b09f99
LOG: database system was shut down at 2015-09-16 14:26:21 UTC
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
Showing memory statistics before row 1.
ExecutorState: 8192 total in 1 blocks; 2720 free (1 chunks); 5472 used
printtup: 0 total in 0 blocks; 0 free (0 chunks); 0 used
tds_fdw data: 8192 total in 1 blocks; 8112 free (0 chunks); 80 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
Showing memory statistics after row 1.
ExecutorState: 8192 total in 1 blocks; 2720 free (1 chunks); 5472 used
@tskenb
tskenb / postgres_log.fd5b441
Created September 16, 2015 15:17
tds_fdw issue 29 log file for commit fd5b441
LOG: database system was shut down at 2015-09-16 14:36:47 UTC
LOG: autovacuum launcher started
LOG: database system is ready to accept connections
Showing memory statistics before row 1.
ExecutorState: 8192 total in 1 blocks; 2720 free (1 chunks); 5472 used
printtup: 0 total in 0 blocks; 0 free (0 chunks); 0 used
tds_fdw data: 8192 total in 1 blocks; 8112 free (0 chunks); 80 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
Showing memory statistics after row 1.
ExecutorState: 8192 total in 1 blocks; 2720 free (1 chunks); 5472 used