Better handling of blobs, query print length limited by compiler flag
This commit is contained in:
@@ -13,12 +13,19 @@
|
||||
#ifndef SQL_DEBUG_COLOUR
|
||||
# define SQL_DEBUG_COLOUR 36
|
||||
#endif
|
||||
#ifndef SQL_DEBUG_MAX_LEN
|
||||
# define SQL_DEBUG_MAX_LEN 512
|
||||
#endif
|
||||
|
||||
|
||||
uint64_t simpleQuery(struct stored_conn_t *sconn, const char *qry, size_t qry_len)
|
||||
{
|
||||
#if defined DEBUG || defined SQL_DEBUG
|
||||
printf("\x1b[%dm" "QRY: %s" "\x1b[0m" "\n", SQL_DEBUG_COLOUR, qry);
|
||||
printf("\x1b[%dm" "QRY: %.*s%s" "\x1b[0m" "\n",
|
||||
SQL_DEBUG_COLOUR,
|
||||
SQL_DEBUG_MAX_LEN, qry,
|
||||
(qry_len > SQL_DEBUG_MAX_LEN ? "..." : "")
|
||||
);
|
||||
#endif
|
||||
|
||||
char *old_ptr;
|
||||
|
||||
Reference in New Issue
Block a user