aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/statement-processing.cxx44
-rw-r--r--odb/statement.hxx4
2 files changed, 44 insertions, 4 deletions
diff --git a/odb/statement-processing.cxx b/odb/statement-processing.cxx
index f647966..ed5bad5 100644
--- a/odb/statement-processing.cxx
+++ b/odb/statement-processing.cxx
@@ -6,14 +6,19 @@
// to minimize statically-linked object code size when processing
// is not used.
+//#define LIBODB_DEBUG_STATEMENT_PROCESSING 1
+//#define LIBODB_TRACE_STATEMENT_PROCESSING 1
+
#include <cassert>
+#ifdef LIBODB_TRACE_STATEMENT_PROCESSING
+# include <iostream>
+#endif
+
#include <odb/statement.hxx>
using namespace std;
-// #define LIBODB_DEBUG_STATEMENT_PROCESSING 1
-
namespace odb
{
typedef char_traits<char> traits;
@@ -310,6 +315,13 @@ namespace odb
r.append (trailer_begin, trailer_size);
}
+#ifdef LIBODB_TRACE_STATEMENT_PROCESSING
+ if (r.size () != n)
+ cerr << endl
+ << "old: '" << s << "'" << endl << endl
+ << "new: '" << r << "'" << endl << endl;
+#endif
+
return;
}
@@ -395,6 +407,13 @@ namespace odb
r += ' ';
r.append (trailer_begin, trailer_size);
}
+
+#ifdef LIBODB_TRACE_STATEMENT_PROCESSING
+ if (r.size () != n)
+ cerr << endl
+ << "old: '" << s << "'" << endl << endl
+ << "new: '" << r << "'" << endl << endl;
+#endif
}
void statement::
@@ -484,6 +503,13 @@ namespace odb
r.append (trailer_begin, trailer_size);
}
+#ifdef LIBODB_TRACE_STATEMENT_PROCESSING
+ if (r.size () != n)
+ cerr << endl
+ << "old: '" << s << "'" << endl << endl
+ << "new: '" << r << "'" << endl << endl;
+#endif
+
return;
}
@@ -526,6 +552,13 @@ namespace odb
r += ' ';
r.append (trailer_begin, trailer_size);
}
+
+#ifdef LIBODB_TRACE_STATEMENT_PROCESSING
+ if (r.size () != n)
+ cerr << endl
+ << "old: '" << s << "'" << endl << endl
+ << "new: '" << r << "'" << endl << endl;
+#endif
}
void statement::
@@ -766,5 +799,12 @@ namespace odb
r.erase (join_pos - 1, n + 1); // Extra one for space.
}
}
+
+#ifdef LIBODB_TRACE_STATEMENT_PROCESSING
+ if (r.size () != n)
+ cerr << endl
+ << "old: '" << s << "'" << endl << endl
+ << "new: '" << r << "'" << endl << endl;
+#endif
}
}
diff --git a/odb/statement.hxx b/odb/statement.hxx
index 00ffa2e..79a8524 100644
--- a/odb/statement.hxx
+++ b/odb/statement.hxx
@@ -84,8 +84,8 @@ namespace odb
// SELECT\n
// [schema.]table.a,\n
// alias.b\n
- // FROM [schema.]table\n
- // [LEFT JOIN [schema.]table [AS alias] ON ...\n]*
+ // FROM [schema.]table[\n]
+ // [LEFT JOIN [schema.]table [AS alias] ON ...[\n]]*
// [WHERE ...]
//
static void