1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge mysql.com:/home/psergey/mysql-4.1-bug7816

into mysql.com:/home/psergey/mysql-5.0-bug7716


sql/item_cmpfunc.cc:
  Auto merged
sql/sql_string.h:
  Auto merged
This commit is contained in:
unknown
2005-02-05 01:52:17 +03:00
4 changed files with 50 additions and 0 deletions

View File

@ -210,6 +210,11 @@ public:
{
if (&s != this)
{
/*
It is forbidden to do assignments like
some_string = substring_of_that_string
*/
DBUG_ASSERT(!s.uses_buffer_owned_by(this));
free();
Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length;
alloced=0;
@ -343,4 +348,9 @@ public:
/* Swap two string objects. Efficient way to exchange data without memcpy. */
void swap(String &s);
inline bool uses_buffer_owned_by(const String *s) const
{
return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length);
}
};