Skip to content

Commit

Permalink
Trace to file was missing messages, tracing test suite did not work.
Browse files Browse the repository at this point in the history
Test suite was a simple typo problem, simply set tracing flag.

Trace messages missing from file (but present when stderr used)
was caused by IF logic problem. Thanks to Ralph Loen for spotting
the rouge semi-colon!


git-svn-id: http://code.ingres.com/ingres/drivers/python/main@1874 45b5d43f-8932-4c86-835a-3654e5842839
  • Loading branch information
clach04 committed Aug 19, 2009
1 parent 7e466cb commit af8f961
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion dbi/iidbiutil.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
** vim:filetype=c:ts=4:sw=4:et:nowrap
** Copyright (c) 2008 Ingres Corporation
**
** This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -65,6 +66,10 @@ char* dbi_trcfile = NULL;
** Trac Ticket #160 - "No such file or directory" on disable trace
** dbi_trace() was returning an uninitialized variable causing
** crashes when Tracing was set to off "(0, None)".
** 19-Aug-2009 (Chris.Clark@ingres.com)
** Fixed issue with tracing to file, every other trace message
** was lost due to if-then block of code ALWAYS being ran due
** to short cut on IF check (trailing semi-colon).
**/

/*{
Expand Down Expand Up @@ -351,7 +356,7 @@ dbi_format( char* fmt, ... )
{
if (dbi_dbgfd == NULL)
{
if ((dbi_dbgfd = fopen( dbi_trcfile, "a" )) == NULL);
if ((dbi_dbgfd = fopen( dbi_trcfile, "a" )) == NULL)
{
ret_val = FALSE;
goto dbi_format_end;
Expand Down
5 changes: 3 additions & 2 deletions tests/test_ingresdbi_dbapi20.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
Cleaned up createdb failure code.
Cleaned up procedure creation/check code.
Added Unicode check.
19-Aug-2009 (Chris.Clark@ingres.com)
Tracing information was not being passed to the driver correctly.
"""
import dbapi20
import unittest
Expand Down Expand Up @@ -149,8 +151,7 @@ class test_Ingresdbi(dbapi20.DatabaseAPI20Test):
if pooled != None:
connect_kw_args.setdefault('pooled', pooled)
trace=(traceLevel, traceFile)
else:
trace=(0, None)
trace=(traceLevel, traceFile)
connect_kw_args.setdefault('trace',trace)
table_prefix = 'dbapi20test_' # If you need to specify a prefix for tables

Expand Down

0 comments on commit af8f961

Please sign in to comment.