]> git.sven.stormbind.net Git - sven/mysqltcl.git/blob - tests/testMapError.tcl
Imported Upstream version 3.05
[sven/mysqltcl.git] / tests / testMapError.tcl
1 if {[file exists libload.tcl]} {
2     source libload.tcl
3 } else {
4     source [file join [file dirname [info script]] libload.tcl]
5 }
6
7
8 # global connect variables
9 set dbuser root
10 set dbpassword ""
11 set dbank mysqltcltest
12
13 package require tcltest
14 variable SETUP {#common setup code}
15 variable CLEANUP {#common cleanup code}
16 tcltest::configure -verbose bet
17
18 proc getConnection {{addOptions {}} {withDB 1}} {
19     global dbuser dbpassword dbank
20     if {$withDB} {
21         append addOptions " -db $dbank"
22     }
23     if {$dbpassword ne ""} {
24             append addOptions " -password $dbpassword"
25     }
26     return [eval mysqlconnect -user $dbuser $addOptions]
27 }
28
29 set c [getConnection]
30 proc t {} {mysql::sel $::c {select Name from Student}}
31 t
32 namespace eval :: {
33         set n 3
34         mysql::sel $c {select Name from Student}
35         mysql::map $c n {
36                 puts "$n"
37         }
38         mysql::receive $c {select Name from Student} { n } {
39                 puts "$n"
40         }
41 }
42
43 #0  0x08002220 in ?? ()
44 #1  0x00185ab4 in TclObjLookupVar () from /opt/tcl845-debug//lib/libtcl8.4.so
45 #2  0x001864f8 in Tcl_ObjSetVar2 () from /opt/tcl845-debug//lib/libtcl8.4.so
46 #3  0x008967d7 in Mysqltcl_Map () from /home/artur/programs/mysqltcl/libmysqltcl3.01.so
47 #4  0x001306db in TclEvalObjvInternal () from /opt/tcl845-debug//lib/libtcl8.4.so
48 #5  0x00151eba in TclExecuteByteCode () from /opt/tcl845-debug//lib/libtcl8.4.so
49 #6  0x001513c0 in TclCompEvalObj () from /opt/tcl845-debug//lib/libtcl8.4.so
50 #7  0x001315e6 in Tcl_EvalObjEx () from /opt/tcl845-debug//lib/libtcl8.4.so
51 #8  0x0015d65b in Tcl_RecordAndEvalObj () from /opt/tcl845-debug//lib/libtcl8.4.so
52 #9  0x0016fd39 in Tcl_Main () from /opt/tcl845-debug//lib/libtcl8.4.so
53 #10 0x080486e6 in main ()