diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-11-27 17:46:20 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-11-27 17:46:20 +0100 |
commit | effed09bd7d8081704eaa017060da84c32e3bf29 (patch) | |
tree | 9dd712312526cdbac1ab622efcdfc28e3fce965a /sql/gstream.cc | |
parent | 7189f09aa6d434fc889cb6d819e97c09f8cc0bcf (diff) | |
parent | 12e60c4989ce0214da88faad7c08d2f046885327 (diff) | |
download | mariadb-git-effed09bd7d8081704eaa017060da84c32e3bf29.tar.gz |
5.3->5.5 merge
Diffstat (limited to 'sql/gstream.cc')
-rw-r--r-- | sql/gstream.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sql/gstream.cc b/sql/gstream.cc index 61263380411..3a9e478c376 100644 --- a/sql/gstream.cc +++ b/sql/gstream.cc @@ -41,6 +41,29 @@ enum Gis_read_stream::enum_tok_types Gis_read_stream::get_next_toc_type() } +bool Gis_read_stream::lookup_next_word(LEX_STRING *res) +{ + const char *cur= m_cur; + + skip_space(); + res->str= (char*) cur; + /* The following will also test for \0 */ + if ((cur >= m_limit) || !my_isvar_start(&my_charset_bin, *cur)) + return 1; + + /* + We can't combine the following increment with my_isvar() because + my_isvar() is a macro that would cause side effects + */ + cur++; + while ((cur < m_limit) && my_isvar(&my_charset_bin, *cur)) + cur++; + + res->length= (uint32) (cur - res->str); + return 0; +} + + bool Gis_read_stream::get_next_word(LEX_STRING *res) { skip_space(); |