summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 2e60b8aad24..aece4230fe0 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1121,7 +1121,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
else the lengths are calculated from the offset between pointers.
**************************************************************************/
-void cli_fetch_lengths(ulong *to, MYSQL_ROW column,
+static void cli_fetch_lengths(ulong *to, MYSQL_ROW column,
unsigned int field_count)
{
ulong *prev_length;
@@ -2628,6 +2628,25 @@ mysql_fetch_row(MYSQL_RES *res)
}
+/**************************************************************************
+ Get column lengths of the current row
+ If one uses mysql_use_result, res->lengths contains the length information,
+ else the lengths are calculated from the offset between pointers.
+**************************************************************************/
+
+ulong * STDCALL
+mysql_fetch_lengths(MYSQL_RES *res)
+{
+ MYSQL_ROW column;
+
+ if (!(column=res->current_row))
+ return 0; /* Something is wrong */
+ if (res->data)
+ (*res->methods->fetch_lengths)(res->lengths, column, res->field_count);
+ return res->lengths;
+}
+
+
int STDCALL
mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg)
{