Skip to content

Commit

Permalink
increase sql-value buffer for pretty printing, typo, add test target
Browse files Browse the repository at this point in the history
  • Loading branch information
gsauthof committed Jul 9, 2013
1 parent 8e35206 commit ff265b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
libtraceproc - a library for tracing [Pro*C][proc] and [OCI][oci] calls

It is implemented as shared library which intercepts Pro*C/OCI
It is implemented as a shared library which intercepts Pro*C/OCI
calls when preloaded. Since DB libraries like [OCCI][occi] and
[OTL][otl] also use low-level OCI-calls, one get useful trace
results there, too.
Expand Down
6 changes: 6 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ genmod: genmodsql genmodgory genmodoci

testmod: testmodsql testmodgory testmodoci



.PHONY: test

test: testunit testmod

###########################################################################
# Test programs
###########################################################################
Expand Down
10 changes: 5 additions & 5 deletions prettyprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,15 @@ static int pp_para_sql_value(const Statement *stmt,
bool before,
void *user_ptr)
{
char buffer[512] = {0};
char buffer[2048] = {0};
if (p->indicator == -1) {
tprintf("NULL");
} else {
switch (p->type)
{
case STRING :
sql_quote_str((const char*)p->value, strlen((const char*)p->value),
buffer, 512);
buffer, 2048);
tprintf("%s", buffer);
break;
case DOUBLE :
Expand All @@ -303,18 +303,18 @@ static int pp_para_sql_value(const Statement *stmt,
case VARCHAR:
{
const varchar *v = p->value;
sql_quote_str((const char*)v->arr, (size_t)v->len, buffer, 512);
sql_quote_str((const char*)v->arr, (size_t)v->len, buffer, 2048);
tprintf("%s", buffer);
}
break;
case STRING0:
sql_quote_str((const char*)p->value, strlen((const char*)p->value),
buffer, 512);
buffer, 2048);
tprintf("%s", buffer);
break;
case CHAR:
sql_quote_str((const char*)p->value, 1,
buffer, 512);
buffer, 2048);
tprintf("%s", buffer);
break;
default:
Expand Down

0 comments on commit ff265b3

Please sign in to comment.