You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

194 lines
7.7 KiB

Applying InnoDB Plugin 1.0.5 snapshot, part 2 From r5639 to r5685 Detailed revision comments: r5639 | marko | 2009-08-06 05:39:34 -0500 (Thu, 06 Aug 2009) | 3 lines branches/zip: mem_heap_block_free(): If innodb_use_sys_malloc is set, do not tell Valgrind that the memory is free, to avoid a bogus warning in Valgrind's built-in free() hook. r5642 | calvin | 2009-08-06 18:04:03 -0500 (Thu, 06 Aug 2009) | 2 lines branches/zip: remove duplicate "the" in comments. r5662 | marko | 2009-08-11 04:54:16 -0500 (Tue, 11 Aug 2009) | 1 line branches/zip: Bump the version number to 1.0.5 after releasing 1.0.4. r5663 | marko | 2009-08-11 06:42:37 -0500 (Tue, 11 Aug 2009) | 2 lines branches/zip: trx_general_rollback_for_mysql(): Remove the redundant parameter partial. If savept==NULL, partial==FALSE. r5670 | marko | 2009-08-12 08:16:37 -0500 (Wed, 12 Aug 2009) | 2 lines branches/zip: trx_undo_rec_copy(): Add const qualifier to undo_rec. This is a non-functional change. r5671 | marko | 2009-08-13 03:46:33 -0500 (Thu, 13 Aug 2009) | 5 lines branches/zip: ha_innobase::add_index(): Fix Bug #46557: after a successful operation, read innodb_table->flags from the newly created table object, not from the old one that was just freed. Approved by Sunny. r5681 | sunny | 2009-08-14 01:16:24 -0500 (Fri, 14 Aug 2009) | 3 lines branches/zip: When building HotBackup srv_use_sys_malloc is #ifdef out. We move access to the this variable within a !UNIV_HOTBACKUP block. r5684 | sunny | 2009-08-20 03:05:30 -0500 (Thu, 20 Aug 2009) | 10 lines branches/zip: Fix bug# 46650: Innodb assertion autoinc_lock == lock in lock_table_remove_low on INSERT SELECT We only store the autoinc locks that are granted in the transaction's autoinc lock vector. A transacton, that has been rolled back due to a deadlock because of an AUTOINC lock attempt, will not have added that lock to the vector. We need to check for that when we remove that lock. rb://145 Approved by Marko. r5685 | sunny | 2009-08-20 03:18:29 -0500 (Thu, 20 Aug 2009) | 2 lines branches/zip: Update the ChangeLog with r5684 change.
16 years ago
  1. /*****************************************************************************
  2. Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
  3. This program is free software; you can redistribute it and/or modify it under
  4. the terms of the GNU General Public License as published by the Free Software
  5. Foundation; version 2 of the License.
  6. This program is distributed in the hope that it will be useful, but WITHOUT
  7. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along with
  10. this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  11. Place, Suite 330, Boston, MA 02111-1307 USA
  12. *****************************************************************************/
  13. /*******************************************************************//**
  14. @file include/rem0cmp.h
  15. Comparison services for records
  16. Created 7/1/1994 Heikki Tuuri
  17. ************************************************************************/
  18. #ifndef rem0cmp_h
  19. #define rem0cmp_h
  20. #include "univ.i"
  21. #include "data0data.h"
  22. #include "data0type.h"
  23. #include "dict0dict.h"
  24. #include "rem0rec.h"
  25. /*************************************************************//**
  26. Returns TRUE if two columns are equal for comparison purposes.
  27. @return TRUE if the columns are considered equal in comparisons */
  28. UNIV_INTERN
  29. ibool
  30. cmp_cols_are_equal(
  31. /*===============*/
  32. const dict_col_t* col1, /*!< in: column 1 */
  33. const dict_col_t* col2, /*!< in: column 2 */
  34. ibool check_charsets);
  35. /*!< in: whether to check charsets */
  36. /*************************************************************//**
  37. This function is used to compare two data fields for which we know the
  38. data type.
  39. @return 1, 0, -1, if data1 is greater, equal, less than data2, respectively */
  40. UNIV_INLINE
  41. int
  42. cmp_data_data(
  43. /*==========*/
  44. ulint mtype, /*!< in: main type */
  45. ulint prtype, /*!< in: precise type */
  46. const byte* data1, /*!< in: data field (== a pointer to a memory
  47. buffer) */
  48. ulint len1, /*!< in: data field length or UNIV_SQL_NULL */
  49. const byte* data2, /*!< in: data field (== a pointer to a memory
  50. buffer) */
  51. ulint len2); /*!< in: data field length or UNIV_SQL_NULL */
  52. /*************************************************************//**
  53. This function is used to compare two data fields for which we know the
  54. data type.
  55. @return 1, 0, -1, if data1 is greater, equal, less than data2, respectively */
  56. UNIV_INTERN
  57. int
  58. cmp_data_data_slow(
  59. /*===============*/
  60. ulint mtype, /*!< in: main type */
  61. ulint prtype, /*!< in: precise type */
  62. const byte* data1, /*!< in: data field (== a pointer to a memory
  63. buffer) */
  64. ulint len1, /*!< in: data field length or UNIV_SQL_NULL */
  65. const byte* data2, /*!< in: data field (== a pointer to a memory
  66. buffer) */
  67. ulint len2); /*!< in: data field length or UNIV_SQL_NULL */
  68. /*************************************************************//**
  69. This function is used to compare two dfields where at least the first
  70. has its data type field set.
  71. @return 1, 0, -1, if dfield1 is greater, equal, less than dfield2,
  72. respectively */
  73. UNIV_INLINE
  74. int
  75. cmp_dfield_dfield(
  76. /*==============*/
  77. const dfield_t* dfield1,/*!< in: data field; must have type field set */
  78. const dfield_t* dfield2);/*!< in: data field */
  79. /*************************************************************//**
  80. This function is used to compare a data tuple to a physical record.
  81. Only dtuple->n_fields_cmp first fields are taken into account for
  82. the data tuple! If we denote by n = n_fields_cmp, then rec must
  83. have either m >= n fields, or it must differ from dtuple in some of
  84. the m fields rec has. If rec has an externally stored field we do not
  85. compare it but return with value 0 if such a comparison should be
  86. made.
  87. @return 1, 0, -1, if dtuple is greater, equal, less than rec,
  88. respectively, when only the common first fields are compared, or until
  89. the first externally stored field in rec */
  90. UNIV_INTERN
  91. int
  92. cmp_dtuple_rec_with_match(
  93. /*======================*/
  94. const dtuple_t* dtuple, /*!< in: data tuple */
  95. const rec_t* rec, /*!< in: physical record which differs from
  96. dtuple in some of the common fields, or which
  97. has an equal number or more fields than
  98. dtuple */
  99. const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
  100. ulint* matched_fields, /*!< in/out: number of already completely
  101. matched fields; when function returns,
  102. contains the value for current comparison */
  103. ulint* matched_bytes); /*!< in/out: number of already matched
  104. bytes within the first field not completely
  105. matched; when function returns, contains the
  106. value for current comparison */
  107. /**************************************************************//**
  108. Compares a data tuple to a physical record.
  109. @see cmp_dtuple_rec_with_match
  110. @return 1, 0, -1, if dtuple is greater, equal, less than rec, respectively */
  111. UNIV_INTERN
  112. int
  113. cmp_dtuple_rec(
  114. /*===========*/
  115. const dtuple_t* dtuple, /*!< in: data tuple */
  116. const rec_t* rec, /*!< in: physical record */
  117. const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
  118. /**************************************************************//**
  119. Checks if a dtuple is a prefix of a record. The last field in dtuple
  120. is allowed to be a prefix of the corresponding field in the record.
  121. @return TRUE if prefix */
  122. UNIV_INTERN
  123. ibool
  124. cmp_dtuple_is_prefix_of_rec(
  125. /*========================*/
  126. const dtuple_t* dtuple, /*!< in: data tuple */
  127. const rec_t* rec, /*!< in: physical record */
  128. const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
  129. /*************************************************************//**
  130. Compare two physical records that contain the same number of columns,
  131. none of which are stored externally.
  132. @return 1, 0, -1 if rec1 is greater, equal, less, respectively, than rec2 */
  133. UNIV_INTERN
  134. int
  135. cmp_rec_rec_simple(
  136. /*===============*/
  137. const rec_t* rec1, /*!< in: physical record */
  138. const rec_t* rec2, /*!< in: physical record */
  139. const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
  140. const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
  141. const dict_index_t* index); /*!< in: data dictionary index */
  142. /*************************************************************//**
  143. This function is used to compare two physical records. Only the common
  144. first fields are compared, and if an externally stored field is
  145. encountered, then 0 is returned.
  146. @return 1, 0, -1 if rec1 is greater, equal, less, respectively */
  147. UNIV_INTERN
  148. int
  149. cmp_rec_rec_with_match(
  150. /*===================*/
  151. const rec_t* rec1, /*!< in: physical record */
  152. const rec_t* rec2, /*!< in: physical record */
  153. const ulint* offsets1,/*!< in: rec_get_offsets(rec1, index) */
  154. const ulint* offsets2,/*!< in: rec_get_offsets(rec2, index) */
  155. dict_index_t* index, /*!< in: data dictionary index */
  156. ulint* matched_fields, /*!< in/out: number of already completely
  157. matched fields; when the function returns,
  158. contains the value the for current
  159. comparison */
  160. ulint* matched_bytes);/*!< in/out: number of already matched
  161. bytes within the first field not completely
  162. matched; when the function returns, contains
  163. the value for the current comparison */
  164. /*************************************************************//**
  165. This function is used to compare two physical records. Only the common
  166. first fields are compared.
  167. @return 1, 0 , -1 if rec1 is greater, equal, less, respectively, than
  168. rec2; only the common first fields are compared */
  169. UNIV_INLINE
  170. int
  171. cmp_rec_rec(
  172. /*========*/
  173. const rec_t* rec1, /*!< in: physical record */
  174. const rec_t* rec2, /*!< in: physical record */
  175. const ulint* offsets1,/*!< in: rec_get_offsets(rec1, index) */
  176. const ulint* offsets2,/*!< in: rec_get_offsets(rec2, index) */
  177. dict_index_t* index); /*!< in: data dictionary index */
  178. #ifndef UNIV_NONINL
  179. #include "rem0cmp.ic"
  180. #endif
  181. #endif