MXS-2441: Extend maxsql extraction functions

Having helper methods that combine the index position search and value
extraction make it easier to deal with results that have a lot of fields
e.g. the output of SHOW SLAVE STATUS.
This commit is contained in:
Markus Mäkelä
2019-04-17 15:48:32 +03:00
parent 24fc82e160
commit dda813f3aa
2 changed files with 39 additions and 0 deletions

View File

@ -115,6 +115,7 @@ public:
* @return Value as string
*/
std::string get_string(int64_t column_ind) const;
std::string get_string(const std::string& name) const;
/**
* Read an integer value from the current row and given column.
@ -123,6 +124,7 @@ public:
* @return Value as integer. If the data could not be parsed an error flag is set.
*/
int64_t get_int(int64_t column_ind) const;
int64_t get_int(const std::string& name) const;
/**
* Check if field is null.
@ -140,6 +142,7 @@ public:
* @return Value as boolean. Returns true if the field contains '1'.
*/
bool get_bool(int64_t column_ind) const;
bool get_bool(const std::string& name) const;
/**
* Has a parsing error occurred during current row?