tdbc::odbc

Check-in [f4b760f215]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Finished advancing release number to 1.0b13. Upgraded tdbcodbc for better portability to legacy drivers. Revised tests so that separate drivers test suites have separate environment variables, and rationalized DRIVER= selection on the ODBC tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f4b760f215c56ed860dbca63647b00993b05ef8e
User & Date: 200002852 2009-09-29 14:44:49
Context
2009-09-29
14:56
Updated recipe for release management and packager for Windows binaries to include Postgres check-in: e8ac920205 user: 200002852 tags: trunk, 1.0b13
14:44
Finished advancing release number to 1.0b13. Upgraded tdbcodbc for better portability to legacy drivers. Revised tests so that separate drivers test suites have separate environment variables, and rationalized DRIVER= selection on the ODBC tests. check-in: f4b760f215 user: 200002852 tags: trunk
2009-09-23
17:40
* generic/tdbcpostgres.c: Removed an ugly workaround for a bug in Tcl_SubstObj. check-in: b65be9b9ed user: 200002852 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to MakingReleases.txt.

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
    tdbcsqlite3/ChangeLog

(2) Commit to fossil. Tag the release. Sync. Make a clean install of all four
    packages inside a virgin Tcl/Tk.  Copy libmysql.dll into the tdbcmysql
    lib directory, and install the sqlite3 package. Run tests against
    the installed version.

    (mysql TEST_DB=test)
    (postgres TEST_USER=tdbc_test TEST_PASSWD=tdbc_test TEST_DB=tdbc_test)

(3) make dist

(4) cd /tmp/dist/tdbc1.0b2
    dos2unix win/*

(5) Import the distribution into Tcl's repository on the vendor branch:






|
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
    tdbcsqlite3/ChangeLog

(2) Commit to fossil. Tag the release. Sync. Make a clean install of all four
    packages inside a virgin Tcl/Tk.  Copy libmysql.dll into the tdbcmysql
    lib directory, and install the sqlite3 package. Run tests against
    the installed version.

    (mysql TDBCMYSQL_DB=test)
    (postgres TDBCPOSTGRES_USER=tdbc_test TDBCPOSTGRES_PASSWD=tdbc_test TDBCPOSTGRES_DB=tdbc_test)

(3) make dist

(4) cd /tmp/dist/tdbc1.0b2
    dos2unix win/*

(5) Import the distribution into Tcl's repository on the vendor branch:

Changes to tdbc/ChangeLog.

1
2
3
4
5
6
7
8
9
10
11
12
13
2009-09-20  Kevin B. Kenny  <[email protected]>

	* tools/tdbc-man2html.tcl: Added tdbcpostgres to the documentation set.
	* generic/tdbc.h:
	* configure.in:
	* README:		Advance version number to 1.0b12
	* configure:		autoconf-2.59
	
2009-07-02  Kevin B. Kenny  <[email protected]>

	* generic/tdbc.h:
	* configure.in:
	* README:		Advance version number to 1.0b12




|







1
2
3
4
5
6
7
8
9
10
11
12
13
2009-09-20  Kevin B. Kenny  <[email protected]>

	* tools/tdbc-man2html.tcl: Added tdbcpostgres to the documentation set.
	* generic/tdbc.h:
	* configure.in:
	* README:		Advance version number to 1.0b13
	* configure:		autoconf-2.59
	
2009-07-02  Kevin B. Kenny  <[email protected]>

	* generic/tdbc.h:
	* configure.in:
	* README:		Advance version number to 1.0b12

Changes to tdbcmysql/ChangeLog.







1
2
3
4
5
6
7





2009-09-20  Kevin B. Kenny  <[email protected]>

	* README:
	* configure.in:		Advance version number to 1.0b13
	* configure:		autoconf-2.59
	
2009-07-03  Kevin B. Kenny  <[email protected]>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2009-09-29  Kevin B. Kenny  <[email protected]>

	* tests/tdbcmysql.test: Changed all TEST_* environment variables
				to TDBCMYSQL_* for easier high-level scripting
				of the tests.
	
2009-09-20  Kevin B. Kenny  <[email protected]>

	* README:
	* configure.in:		Advance version number to 1.0b13
	* configure:		autoconf-2.59
	
2009-07-03  Kevin B. Kenny  <[email protected]>

Changes to tdbcmysql/tests/tdbcmysql.test.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# We need to know the parameters of the MySQL database for testing.

set connFlags {}
if {[info exists env(TEST_HOST)]} {
    lappend connFlags -host $env(TEST_HOST)
}
if {[info exists env(TEST_USER)]} {
    lappend connFlags -user $env(TEST_USER)
}
if {[info exists env(TEST_PASSWD)]} {
    lappend connFlags -passwd $env(TEST_PASSWD)
}
if {[info exists env(TEST_DB)]} {
    lappend connFlags -db $env(TEST_DB)
} else {
    lappend connFlags -db tdbc_test
}
if {[info exists env(TEST_SOCKET)]} {
    lappend connFlags -socket $env(TEST_SOCKET)
}
if {[info exists env(TEST_PORT)]} {
    lappend connFlags -port $env(TEST_PORT)
}

#------------------------------------------------------------------------------

test tdbc::mysql-1.1 {create a connection, wrong # args} {*}{
    -body {
	tdbc::mysql::connection create






|
|

|
|

|
|

|
|



|
|

|
|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# We need to know the parameters of the MySQL database for testing.

set connFlags {}
if {[info exists env(TDBCMYSQL_HOST)]} {
    lappend connFlags -host $env(TDBCMYSQL_HOST)
}
if {[info exists env(TDBCMYSQL_USER)]} {
    lappend connFlags -user $env(TDBCMYSQL_USER)
}
if {[info exists env(TDBCMYSQL_PASSWD)]} {
    lappend connFlags -passwd $env(TDBCMYSQL_PASSWD)
}
if {[info exists env(TDBCMYSQL_DB)]} {
    lappend connFlags -db $env(TDBCMYSQL_DB)
} else {
    lappend connFlags -db tdbc_test
}
if {[info exists env(TDBCMYSQL_SOCKET)]} {
    lappend connFlags -socket $env(TDBCMYSQL_SOCKET)
}
if {[info exists env(TDBCMYSQL_PORT)]} {
    lappend connFlags -port $env(TDBCMYSQL_PORT)
}

#------------------------------------------------------------------------------

test tdbc::mysql-1.1 {create a connection, wrong # args} {*}{
    -body {
	tdbc::mysql::connection create

Changes to tdbcodbc/ChangeLog.












1
2
3
4
5
6
7










2009-09-20  Kevin B. Kenny  <[email protected]>

	* README:
	* configure.in:		Advance version number to 1.0b13
	* configure:		autoconf-2.59
	
2009-07-02  Kevin B. Kenny  <[email protected]>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2009-09-29  Kevin B. Kenny  <[email protected]>

	* Makefile.in:		Changed 'test' rule to test all available
				database types.
	* tests/tdbcodbc.test:	Changed all TEST_* env vars to TDBCODBC_*
				for easier top-level scripting.  Clarified
				and expanded database type selection.
	* generic/tdbcodbc.c:   Replaced SQLSetConnectAttr with the obsolete
				SQLSetConnectOption, for better compatibility
				with older ODBC drivers.
	
2009-09-20  Kevin B. Kenny  <[email protected]>

	* README:
	* configure.in:		Advance version number to 1.0b13
	* configure:		autoconf-2.59
	
2009-07-02  Kevin B. Kenny  <[email protected]>

Changes to tdbcodbc/Makefile.in.

221
222
223
224
225
226
227


228


229
230
231


232





233
234
235
236
237
238
239
	@echo "Installing documentation in $(DESTDIR)$(mandir)"
	@list='$(srcdir)/doc/*.n'; for i in $$list; do \
	    echo "Installing $$i"; \
	    rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
	    $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
	done



test: binaries libraries


	TEST_TYPE=default $(TCLSH) `@[email protected] $(srcdir)/tests/all.tcl` $(TESTFLAGS)

test-sqlserver: binaries libraries


	TEST_TYPE=sqlserver $(TCLSH) `@[email protected] $(srcdir)/tests/all.tcl` $(TESTFLAGS)






shell: binaries libraries
	@$(TCLSH) $(SCRIPT)

gdb:
	$(TCLSH_ENV) $(PKG_ENV) gdb $(TCLSH_PROG) $(SCRIPT)







>
>
|
>
>
|


>
>
|
>
>
>
>
>







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
	@echo "Installing documentation in $(DESTDIR)$(mandir)"
	@list='$(srcdir)/doc/*.n'; for i in $$list; do \
	    echo "Installing $$i"; \
	    rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
	    $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
	done

test: test-jet test-sqlserver test-sqlite

test-jet: binaries libraries
	@echo testing tdbcodbc against Jet
	TDBCODBC_TYPE=jet \
		$(TCLSH) `@[email protected] $(srcdir)/tests/all.tcl` $(TESTFLAGS)

test-sqlserver: binaries libraries
	@echo testing tdbcodbc against SQL Server
	TDBCODBC_TYPE=sqlserver \
		$(TCLSH) `@[email protected] $(srcdir)/tests/all.tcl` $(TESTFLAGS)

test-sqlite: binaries libraries
	@echo testing tdbcodbc against SQLite
	TDBCODBC_TYPE=sqlite \
		$(TCLSH) `@[email protected] $(srcdir)/tests/all.tcl` $(TESTFLAGS)

shell: binaries libraries
	@$(TCLSH) $(SCRIPT)

gdb:
	$(TCLSH_ENV) $(PKG_ENV) gdb $(TCLSH_PROG) $(SCRIPT)

Changes to tdbcodbc/generic/tdbcodbc.c.

2035
2036
2037
2038
2039
2040
2041





2042
2043






2044
2045
2046
2047
2048
2049
2050
static int
SetAutocommitFlag(
    Tcl_Interp* interp,		/* Tcl interpreter */
    ConnectionData* cdata,	/* Instance data for the connection */
    SQLINTEGER flag		/* Auto-commit indicator */
) {
    SQLRETURN rc;





    rc = SQLSetConnectAttr(cdata->hDBC, SQL_ATTR_AUTOCOMMIT,
			   (SQLPOINTER) flag, 0);






    if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
	TransferSQLError(interp, SQL_HANDLE_DBC, cdata->hDBC,
			 "(changing the 'autocommit' attribute)");
	return TCL_ERROR;
    }
    return TCL_OK;
}






>
>
>
>
>


>
>
>
>
>
>







2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
static int
SetAutocommitFlag(
    Tcl_Interp* interp,		/* Tcl interpreter */
    ConnectionData* cdata,	/* Instance data for the connection */
    SQLINTEGER flag		/* Auto-commit indicator */
) {
    SQLRETURN rc;
#if 0
    /*
     * This form is allegedly preferred, but fails with the Windows
     * SQLite3 driver
     */
    rc = SQLSetConnectAttr(cdata->hDBC, SQL_ATTR_AUTOCOMMIT,
			   (SQLPOINTER) flag, 0);
#else
    /*
     * This form is deprecated, but actually works.
     */
    rc = SQLSetConnectOption(cdata->hDBC, SQL_AUTOCOMMIT, flag);
#endif
    if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
	TransferSQLError(interp, SQL_HANDLE_DBC, cdata->hDBC,
			 "(changing the 'autocommit' attribute)");
	return TCL_ERROR;
    }
    return TCL_OK;
}

Changes to tdbcodbc/tests/tdbcodbc.test.

13
14
15
16
17
18
19
20
21
22
23
24
25


























26
27
28
29
30
31
32
33



34
35
36

37


38




39
40
41






42

43

44
45
46
47




48
49
50
51
52



53
54
55
56
57
58
59
....
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
....
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
....
2730
2731
2732
2733
2734
2735
2736
2737

2738
2739
2740
2741
2742








2743
2744
2745
2746
2747
2748
2749
lappend auto_path .
package require tdbc::odbc
if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# Test setup.  We need a database to work on, so copy 'test.mdb' to a
# temp file, and run from it.

if {![info exists env(TEST_TYPE)] || $env(TEST_TYPE) eq {default}} {
    set testdir [makeDirectory tdbctest]
    if {$tcl_platform(platform) eq {windows}} {


























	set testFileName test.mdb
	set testDBName [makeFile {} $testFileName $testdir]
	set f [open [file join [file dirname [info script]] test.mdb] rb]
	set emptyMDB [read $f]
	close $f
	set f [open $testDBName wb]
	puts -nonewline $f $emptyMDB
	close $f



	set testDBQ [file native [file normalize $testDBName]]
	set connStr "DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};"
	append connStr DBQ= $testDBQ

	tcltest::testConstraint jet 1


    } else {




	set testFileName test.db
	set testDBName [file join $testdir $testFileName]
	catch {file delete $testDBName}






	set connStr "DRIVER=SQLite3;"

	append connStr Database= $testDBName

	tcltest::testConstraint sqlite 1
    }
} elseif {$env(TEST_TYPE) eq {sqlserver}} {
    tcltest::testConstraint sqlserver 1




    set dataSource "Provider=SQLNCLI"
    append dataSource \; "Server=." \\ "SQLEXPRESS"
    append dataSource \; "Initial Catalog=kevinTestDB"
    append dataSource \; "Trusted_Connection=yes"
    set connStr "DRIVER=SQL Native Client;$dataSource"



}

tcltest::testConstraint odbcinst \
    [expr {[namespace which -command ::tdbc::odbc::datasource] ne {}}]

#-------------------------------------------------------------------------------

................................................................................
    -body {
	::db columns rubbish
    }
    -result {}
}

# Jet driver promotes varchar to wvarchar
test tdbc::odbc-17.3a {database columns - no match pattern} {*}{
    -constraints jet||sqlserver
    -body {
	set result {}
	dict for {colname attrs} [::db columns people] {
	    lappend result $colname \
		[dict get $attrs type] \
		[expr {[dict exists $attrs precision] ?
		       [dict get $attrs precision] : {NULL}}] \
................................................................................
		[expr {[dict exists $attrs scale] ?
		       [dict get $attrs scale] : {NULL}}] \
		[dict get $attrs nullable]
	}
	set result
    }
    -match glob
    -result {idnum integer * 0 * name *varchar 40 * * info integer * 0 1}
}

test tdbc::odbc-17.3b {database columns - no match pattern} {*}{
    -constraints sqlite
    -body {
	set result {}
	dict for {colname attrs} [::db columns people] {
	    lappend result $colname \
		[dict get $attrs type] \
		[expr {[dict exists $attrs precision] ?
		       [dict get $attrs precision] : {NULL}}] \
		[expr {[dict exists $attrs scale] ?
		       [dict get $attrs scale] : {NULL}}] \
		[dict get $attrs nullable]
	}
	set result
    }
    -match glob
    -result {idnum integer * 0 * name varchar 40 * info integer * 0 1}
}

# sqlite driver appears not to implement pattern matching for SQLGetColumns
test tdbc::odbc-17.4 {database columns - match pattern} {*}{
    -constraints jet||sqlserver
    -body {
	set result {}
................................................................................
	::db configure -isolation junk
    }
    -returnCodes error
    -match glob
    -result {bad isolation level "junk"*}
}

test tdbc::odbc-19.11 {$connection configure - -isolation} {*}{

    -body {
	list [::db configure -isolation readcommitted] \
	    [::db configure -isolation]
    }
    -result {{} readcommitted}








}

test tdbc::odbc-19.12 {$connection configure - -readonly} {*}{
    -body {
	::db configure -readonly junk
    }
    -returnCodes error






|
|

|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








>
>
>



>

>
>
|
>
>
>
>



>
>
>
>
>
>
|
>

>


<
|
>
>
>
>
|
|
|
|
|
>
>
>







 







|
<







 







|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|
>





>
>
>
>
>
>
>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
....
2572
2573
2574
2575
2576
2577
2578
2579

2580
2581
2582
2583
2584
2585
2586
....
2587
2588
2589
2590
2591
2592
2593
2594



















2595
2596
2597
2598
2599
2600
2601
....
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
lappend auto_path .
package require tdbc::odbc
if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# Test setup. Figure out what sort of database we have.  Default on Windows
# is SQL Server Express, and on Unix is SQLite3

if {![info exists env(TDBCODBC_TYPE)] || $env(TDBCODBC_TYPE) eq {default}} {
    set testdir [makeDirectory tdbctest]
    if {$tcl_platform(platform) eq {windows}} {
	set env(TDBCODBC_TYPE) sqlserver
    } else {
	set env(TDBCODBC_TYPE) sqlite
    }
}

# Jet and SQL Server are Windows-only

if {$env(TDBCODBC_TYPE) in {jet sqlserver}} {
    if {$::tcl_platform(platform) ne {windows}} {
	puts stderr "$env(TDBCODBC_TYPE) testing is available on the\
                     Windows platform only"
	cleanupTests
	return
    }
}

# Configure the selected database

switch -exact -- $env(TDBCODBC_TYPE) {

    jet {

	# Begin by creating an empty .MDB file

	set testdir [makeDirectory tdbctest]
	set testFileName test.mdb
	set testDBName [makeFile {} $testFileName $testdir]
	set f [open [file join [file dirname [info script]] test.mdb] rb]
	set emptyMDB [read $f]
	close $f
	set f [open $testDBName wb]
	puts -nonewline $f $emptyMDB
	close $f

	# Set connection string

	set testDBQ [file native [file normalize $testDBName]]
	set connStr "DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};"
	append connStr DBQ= $testDBQ

	tcltest::testConstraint jet 1

    }
    sqlite {

	# Begin with a nonexistent file for the test database

	set testdir [makeDirectory tdbctest]
	set testFileName test.db
	set testDBName [file join $testdir $testFileName]
	catch {file delete $testDBName}

	# Set up the connection string

	if {$::tcl_platform(platform) eq {windows}} {
	    set connStr "DRIVER=SQLite3 ODBC Driver;"
	} else {
	    set connStr "DRIVER=SQLite3;"
	}
	append connStr Database= $testDBName

	tcltest::testConstraint sqlite 1
    }

    sqlserver {

	# Set up the connection string for 'tdbcTestDB' on the
	# local machine using SQLEXPRESS

	set dataSource "Provider=SQLNCLI"
	append dataSource \; "Server=." \\ "SQLEXPRESS"
	append dataSource \; "Initial Catalog=tdbcTestDB"
	append dataSource \; "Trusted_Connection=yes"
	set connStr "DRIVER=SQL Native Client;$dataSource"

	tcltest::testConstraint sqlserver 1
    }
}

tcltest::testConstraint odbcinst \
    [expr {[namespace which -command ::tdbc::odbc::datasource] ne {}}]

#-------------------------------------------------------------------------------

................................................................................
    -body {
	::db columns rubbish
    }
    -result {}
}

# Jet driver promotes varchar to wvarchar
test tdbc::odbc-17.3 {database columns - no match pattern} {*}{

    -body {
	set result {}
	dict for {colname attrs} [::db columns people] {
	    lappend result $colname \
		[dict get $attrs type] \
		[expr {[dict exists $attrs precision] ?
		       [dict get $attrs precision] : {NULL}}] \
................................................................................
		[expr {[dict exists $attrs scale] ?
		       [dict get $attrs scale] : {NULL}}] \
		[dict get $attrs nullable]
	}
	set result
    }
    -match glob
    -result {idnum integer * * * name *varchar 40 * * info integer * * 1}



















}

# sqlite driver appears not to implement pattern matching for SQLGetColumns
test tdbc::odbc-17.4 {database columns - match pattern} {*}{
    -constraints jet||sqlserver
    -body {
	set result {}
................................................................................
	::db configure -isolation junk
    }
    -returnCodes error
    -match glob
    -result {bad isolation level "junk"*}
}

test tdbc::odbc-19.11a {$connection configure - -isolation} {*}{
    -constraints !win||!sqlite
    -body {
	list [::db configure -isolation readcommitted] \
	    [::db configure -isolation]
    }
    -result {{} readcommitted}
}
test tdbc::odbc-19.11b {$connection configure - -isolation} {*}{
    -constraints win&&sqlite
    -body {
	list [::db configure -isolation readcommitted] \
	    [::db configure -isolation]
    }
    -result {{} serializable}
}

test tdbc::odbc-19.12 {$connection configure - -readonly} {*}{
    -body {
	::db configure -readonly junk
    }
    -returnCodes error

Changes to tdbcpostgres/ChangeLog.







1
2
3
4



5
6
7
8
9
10
11





2009-09-23  Kevin B. Kenny  <[email protected]>

	* generic/tdbcpostgres.c: Removed an ugly workaround for a
	                          bug in Tcl_SubstObj.



	
2009-09-19  Kevin B. Kenny  <[email protected]>

	* configure (New file): autoconf 2.59
		(Added pre-built 'configure' so that TEA users don't
		need autoconf, m4 and all that stuff pre-installed)
	* generic/tdbcpostgres.c:   Many changes to upgrade to Tcl Engineering
>
>
>
>
>
>




>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2009-09-29  Kevin B. Kenny  <[email protected]>

	* tests/tdbcpostgres.test: Changed all TEST_* environment variables
				   to TDBCPOSTGRES_* for easier scripting
			 	   of combined builds and tests.
	
2009-09-23  Kevin B. Kenny  <[email protected]>

	* generic/tdbcpostgres.c: Removed an ugly workaround for a
	                          bug in Tcl_SubstObj.
	* configure.in: 
	* README:		Advanced version to 1.0b13
	* configure:		autoconf 2.59
	
2009-09-19  Kevin B. Kenny  <[email protected]>

	* configure (New file): autoconf 2.59
		(Added pre-built 'configure' so that TEA users don't
		need autoconf, m4 and all that stuff pre-installed)
	* generic/tdbcpostgres.c:   Many changes to upgrade to Tcl Engineering

Changes to tdbcpostgres/README.

1
2
3
4
5
6
7
8
9
10
README: tdbcpostgres

    This is the 1.0b12 source distribution of the driver for Tcl
    Database Connectivity (TDBC) to access Postgres databases. TDBC and
    its drivers are available from a Fossil version control repository
    at http://tdbc.tcl.tk/

RCS: @(#) $Id: $

1. Introduction

|







1
2
3
4
5
6
7
8
9
10
README: tdbcpostgres

    This is the 1.0b13 source distribution of the driver for Tcl
    Database Connectivity (TDBC) to access Postgres databases. TDBC and
    its drivers are available from a Fossil version control repository
    at http://tdbc.tcl.tk/

RCS: @(#) $Id: $

1. Introduction

Changes to tdbcpostgres/tests/tdbcpostgres.test.

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# We need to know the parameters of the Postgre database for testing.

set connFlags {}
if {[info exists env(TEST_HOST)]} {
    lappend connFlags -host $env(TEST_HOST)
}
if {[info exists env(TEST_USER)]} {
    lappend connFlags -user $env(TEST_USER)
}
if {[info exists env(TEST_PASSWD)]} {
    lappend connFlags -password $env(TEST_PASSWD)
}
if {[info exists env(TEST_DB)]} {
    lappend connFlags -db $env(TEST_DB)
} else {
    lappend connFlags -db tdbc_test
}
if {[info exists env(TEST_PORT)]} {
    lappend connFlags -port $env(TEST_PORT)
}

#------------------------------------------------------------------------------
test tdbc::postgres-1.1 {create a connection, wrong # args} {*}{
    -body {
	tdbc::postgres::connection create
    }






|
|

|
|

|
|

|
|



|
|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# We need to know the parameters of the Postgre database for testing.

set connFlags {}
if {[info exists env(TDBCPOSTGRES_HOST)]} {
    lappend connFlags -host $env(TDBCPOSTGRES_HOST)
}
if {[info exists env(TDBCPOSTGRES_USER)]} {
    lappend connFlags -user $env(TDBCPOSTGRES_USER)
}
if {[info exists env(TDBCPOSTGRES_PASSWD)]} {
    lappend connFlags -password $env(TDBCPOSTGRES_PASSWD)
}
if {[info exists env(TDBCPOSTGRES_DB)]} {
    lappend connFlags -db $env(TDBCPOSTGRES_DB)
} else {
    lappend connFlags -db tdbc_test
}
if {[info exists env(TDBCPOSTGRES_PORT)]} {
    lappend connFlags -port $env(TDBCPOSTGRES_PORT)
}

#------------------------------------------------------------------------------
test tdbc::postgres-1.1 {create a connection, wrong # args} {*}{
    -body {
	tdbc::postgres::connection create
    }

Changes to tdbcsqlite3/ChangeLog.









1
2
3
4
5
6
7







2009-07-03  Kevin B. Kenny  <[email protected]>

	* tempTest.tcl (removed):	Deleted obsolete test harness;
					this package has used proper tcltest
					testing for months.
	
	* README:			Advanced version number to 1.0b12
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2009-09-29  Kevin B. Kenny  <[email protected]>

	* README:			Advanced version number to 1.0b13
	* configure.in:
	* library/tdbcsqlite3.tcl:
	* configure:			autoconf-2.59

	
2009-07-03  Kevin B. Kenny  <[email protected]>

	* tempTest.tcl (removed):	Deleted obsolete test harness;
					this package has used proper tcltest
					testing for months.
	
	* README:			Advanced version number to 1.0b12

Changes to tdbcsqlite3/README.

1
2
3
4
5
6
7
8
9
10
README: tdbcsqlite3

    This is the 1.0b12 source distribution of the bridge between Tcl
    Database Connectivity (TDBC) and SQLite3, an open-source SQL
    database with an in-process server.
    
    TDBC and its drivers are available from a Fossil version control
    repository at http://tdbc.tcl.tk/

    SQLite3 is available from http://sqlite.org/

|







1
2
3
4
5
6
7
8
9
10
README: tdbcsqlite3

    This is the 1.0b13 source distribution of the bridge between Tcl
    Database Connectivity (TDBC) and SQLite3, an open-source SQL
    database with an in-process server.
    
    TDBC and its drivers are available from a Fossil version control
    repository at http://tdbc.tcl.tk/

    SQLite3 is available from http://sqlite.org/

Changes to tdbcsqlite3/configure.

1
2
3
4
5
6
7
8
9
10
...
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
...
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
...
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
...
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
....
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
....
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for tdbcsqlite3 1.0b12.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##
................................................................................
# This variable seems obsolete.  It should probably be removed, and
# only ac_max_sed_lines should be used.
: ${ac_max_here_lines=38}

# Identity of this package.
PACKAGE_NAME='tdbcsqlite3'
PACKAGE_TARNAME='tdbcsqlite3'
PACKAGE_VERSION='1.0b12'
PACKAGE_STRING='tdbcsqlite3 1.0b12'
PACKAGE_BUGREPORT=''

ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS tdbc_VERSION tdbc_BIN_DIR tdbc_SRC_DIR tdbc_LIB_FILE tdbc_LIB_SPEC tdbc_STUB_LIB_FILE tdbc_STUB_LIB_SPEC tdbc_STUB_LIB_PATH TCL_MAJOR_VERSION TCL_MINOR_VERSION CLEANFILES TCLSH_PROG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIBOBJS LTLIBOBJS'
ac_subst_files=''

# Initialize some variables set by options.
ac_init_help=
................................................................................
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
  # Omit some internal or obsolete options to make the list less imposing.
  # This message is too long to be a string in the A/UX 3.1 sh.
  cat <<_ACEOF
\`configure' configures tdbcsqlite3 1.0b12 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.
................................................................................

  cat <<\_ACEOF
_ACEOF
fi

if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of tdbcsqlite3 1.0b12:";;
   esac
  cat <<\_ACEOF

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-tcl              directory containing tcl configuration
................................................................................
    cd $ac_popdir
  done
fi

test -n "$ac_init_help" && exit 0
if $ac_init_version; then
  cat <<\_ACEOF
tdbcsqlite3 configure 1.0b12
generated by GNU Autoconf 2.59

Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit 0
fi
exec 5>config.log
cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by tdbcsqlite3 $as_me 1.0b12, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ $0 [email protected]

_ACEOF
{
cat <<_ASUNAME
................................................................................
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
} >&5
cat >&5 <<_CSEOF

This file was extended by tdbcsqlite3 $as_me 1.0b12, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 [email protected]
................................................................................
$config_files

Report bugs to <[email protected]>."
_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
tdbcsqlite3 config.status 1.0b12
configured by $0, generated by GNU Autoconf 2.59,
  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir

|







 







|
|







 







|







 







|







 







|













|







 







|







 







|







1
2
3
4
5
6
7
8
9
10
...
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
...
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
...
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
...
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
....
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
....
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for tdbcsqlite3 1.0b13.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##
................................................................................
# This variable seems obsolete.  It should probably be removed, and
# only ac_max_sed_lines should be used.
: ${ac_max_here_lines=38}

# Identity of this package.
PACKAGE_NAME='tdbcsqlite3'
PACKAGE_TARNAME='tdbcsqlite3'
PACKAGE_VERSION='1.0b13'
PACKAGE_STRING='tdbcsqlite3 1.0b13'
PACKAGE_BUGREPORT=''

ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS tdbc_VERSION tdbc_BIN_DIR tdbc_SRC_DIR tdbc_LIB_FILE tdbc_LIB_SPEC tdbc_STUB_LIB_FILE tdbc_STUB_LIB_SPEC tdbc_STUB_LIB_PATH TCL_MAJOR_VERSION TCL_MINOR_VERSION CLEANFILES TCLSH_PROG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIBOBJS LTLIBOBJS'
ac_subst_files=''

# Initialize some variables set by options.
ac_init_help=
................................................................................
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
  # Omit some internal or obsolete options to make the list less imposing.
  # This message is too long to be a string in the A/UX 3.1 sh.
  cat <<_ACEOF
\`configure' configures tdbcsqlite3 1.0b13 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.
................................................................................

  cat <<\_ACEOF
_ACEOF
fi

if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of tdbcsqlite3 1.0b13:";;
   esac
  cat <<\_ACEOF

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-tcl              directory containing tcl configuration
................................................................................
    cd $ac_popdir
  done
fi

test -n "$ac_init_help" && exit 0
if $ac_init_version; then
  cat <<\_ACEOF
tdbcsqlite3 configure 1.0b13
generated by GNU Autoconf 2.59

Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit 0
fi
exec 5>config.log
cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by tdbcsqlite3 $as_me 1.0b13, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ $0 [email protected]

_ACEOF
{
cat <<_ASUNAME
................................................................................
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
} >&5
cat >&5 <<_CSEOF

This file was extended by tdbcsqlite3 $as_me 1.0b13, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 [email protected]
................................................................................
$config_files

Report bugs to <[email protected]>."
_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
tdbcsqlite3 config.status 1.0b13
configured by $0, generated by GNU Autoconf 2.59,
  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir

Changes to tdbcsqlite3/configure.in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash -norc
dnl	This file is an input file used by the GNU "autoconf" program to
dnl	generate the file "configure", which is run during Tcl installation
dnl	to configure the system for the local environment.
#
# RCS: @(#) $Id: configure.in,v 1.48 2008/11/05 00:13:00 hobbs Exp $

AC_INIT([tdbcsqlite3], [1.0b12])

#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash -norc
dnl	This file is an input file used by the GNU "autoconf" program to
dnl	generate the file "configure", which is run during Tcl installation
dnl	to configure the system for the local environment.
#
# RCS: @(#) $Id: configure.in,v 1.48 2008/11/05 00:13:00 hobbs Exp $

AC_INIT([tdbcsqlite3], [1.0b13])

#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------

Changes to tdbcsqlite3/library/tdbcsqlite3.tcl.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# RCS: @(#) $Id: tdbcodbc.tcl,v 1.47 2008/02/27 02:08:27 kennykb Exp $
#
#------------------------------------------------------------------------------

package require tdbc
package require sqlite3

package provide tdbc::sqlite3 1.0b12

namespace eval tdbc::sqlite3 {
    namespace export connection
}

#------------------------------------------------------------------------------
#






|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# RCS: @(#) $Id: tdbcodbc.tcl,v 1.47 2008/02/27 02:08:27 kennykb Exp $
#
#------------------------------------------------------------------------------

package require tdbc
package require sqlite3

package provide tdbc::sqlite3 1.0b13

namespace eval tdbc::sqlite3 {
    namespace export connection
}

#------------------------------------------------------------------------------
#