Update of /cvsroot/monetdb/sql/src/test/mapi/Tests
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17207/src/test/mapi/Tests

Added Files:
        utf8test.SQL.py 
Log Message:
propagated changes of Friday Sep 12 2008
from the SQL_2-24 branch to the development trunk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2008/09/12 - sjoerd: src/test/mapi/Tests/utf8test.SQL.py,1.1.2.1
Use Python instead of a cmd script since the cmd script didn't work.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


--- NEW FILE: utf8test.SQL.py ---
import os, sys
try:
    import subprocess
except ImportError:
    # use private copy for old Python versions
    import MonetDB.subprocess26 as subprocess

def client(cmd):
    clt = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
    sys.stdout.write(clt.stdout.read())
    clt.stdout.close()
    sys.stderr.write(clt.stderr.read())
    clt.stderr.close()

def main():
    mclient = os.getenv('SQL_CLIENT')
    client('%s -s "create table utf8test (s varchar(50))"' % mclient)
    client('%s -s "insert into utf8test values (\'value without special 
characters\')"' % mclient)
    client('%s -s "insert into utf8test values (\'funny characters: 
\303\240\303\241\303\242\303\243\303\244\303\245\')"' % mclient)
    client('%s -fraw -s "select * from utf8test"' % mclient)
    client('%s -fsql -s "select * from utf8test"' % mclient)
    client('%s -fraw -Eiso-8859-1 -s "select * from utf8test"' % mclient)
    client('%s -fsql -Eiso-8859-1 -s "select * from utf8test"' % mclient)
    client('%s -s "drop table utf8test"' % mclient)

main()


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to