mirror of
https://github.com/MariaDB/server.git
synced 2026-04-20 07:15:33 +02:00
Updated with changes from Percona Server 5.1.56-12.7, from
lp:~percona-dev/percona-server/release-5.1.56-12.7 percona-server-5.1.56-12.7 as of April 29, 2011. Merged: revid:ignacio.nin@percona.com-20110427224434-e5a4kpyfwvj641q3
This commit is contained in:
parent
8e0ed9eeba
commit
fecd255a16
83 changed files with 1976 additions and 1280 deletions
|
|
@ -229,20 +229,30 @@ dfield_dup(
|
|||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Tests if data length and content is equal for two dfields.
|
||||
@return TRUE if equal */
|
||||
Tests if two data fields are equal.
|
||||
If len==0, tests the data length and content for equality.
|
||||
If len>0, tests the first len bytes of the content for equality.
|
||||
@return TRUE if both fields are NULL or if they are equal */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dfield_datas_are_binary_equal(
|
||||
/*==========================*/
|
||||
const dfield_t* field1, /*!< in: field */
|
||||
const dfield_t* field2) /*!< in: field */
|
||||
const dfield_t* field2, /*!< in: field */
|
||||
ulint len) /*!< in: maximum prefix to compare,
|
||||
or 0 to compare the whole field length */
|
||||
{
|
||||
ulint len;
|
||||
ulint len2 = len;
|
||||
|
||||
len = field1->len;
|
||||
if (field1->len == UNIV_SQL_NULL || len == 0 || field1->len < len) {
|
||||
len = field1->len;
|
||||
}
|
||||
|
||||
return(len == field2->len
|
||||
if (field2->len == UNIV_SQL_NULL || len2 == 0 || field2->len < len2) {
|
||||
len2 = field2->len;
|
||||
}
|
||||
|
||||
return(len == len2
|
||||
&& (len == UNIV_SQL_NULL
|
||||
|| !memcmp(field1->data, field2->data, len)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue