Skip to content

Commit 4bef986

Browse files
author
Bogdan Degtyariov
committed
Docs update for Column::getLength() and mysqlx_column_get_length() functions
1 parent d6bbd9e commit 4bef986

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

include/devapi/result.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,20 @@ class PUBLIC_API Column
361361

362362
Type getType() const; ///< TODO
363363

364-
unsigned long getLength() const; ///< TODO
364+
/**
365+
Get column length
366+
367+
@return the maximum length of data in the column in bytes
368+
as reported by server.
369+
370+
@note because the column length is returned as byte length
371+
it could be confusing with the multi-byte charsets.
372+
For instance with UTF8MB4 the length of VARCHAR(100)
373+
column is returned as 400 because each character is
374+
4 bytes long.
375+
*/
376+
377+
unsigned long getLength() const;
365378
unsigned short getFractionalDigits() const; ///< TODO
366379
bool isNumberSigned() const; ///< TODO
367380

include/mysql_xapi.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2450,7 +2450,14 @@ mysqlx_column_get_collation(mysqlx_result_t *res, uint32_t pos);
24502450
@param res result handle
24512451
@param pos zero-based column number
24522452
2453-
@return maximum length of data in the column (as reported by server)
2453+
@return maximum length of data in the column in bytes
2454+
as reported by server.
2455+
2456+
@note because the column length is returned as byte length
2457+
it could be confusing with the multi-byte charsets.
2458+
For instance with UTF8MB4 the length of VARCHAR(100)
2459+
column is returned as 400 because each character is
2460+
4 bytes long.
24542461
24552462
@ingroup xapi_md
24562463
*/

0 commit comments

Comments
 (0)