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.

390 lines
6.5 KiB

Approximative fixes for BUG#2610,2611,9100 i.e. WL#2146 binlogging/replication of routines (stored procs and functions). Approximative, because it's using our binlogging way (what we call "query"-level) and this is not as good as record-level binlog (5.1) would be. It imposes several limitations to routines, and has caveats (which I'll document, and for which the server will try to issue errors but that is not always possible). Reason I don't propagate caller info to the binlog as planned is that on master and slave users may be different; even with that some caveats would remain. mysql-test/mysql-test-run.sh: In the testsuite we know what we do, we are not creating nasty routines, and breaking binlog is ok except in rpl_sp. mysql-test/r/blackhole.result: Updating results now that 4.1 has been merged mysql-test/valgrind.supp: Some suppressions for Valgrind (useful on my machine Suse 9.1); this is just adding to the already existing suppressions of pthread and dl. sql/item_func.cc: Don't binlog the substatements when executing a function. If the function is declared to modify data and does not complete, warning "broken binlog". Note that SELECT myfunc() will not be binlogged even if myfunc() updates data (will be documented); but INSERT INTO t VALUES(myfunc()) will be binlogged (what decides is if the caller gets binlogged; the function changes nothing to binlogging). sql/log_event.cc: Just making functions which can be re-used when we binlog more strings in status_vars in Query_log_event (e.g. one day "user", "host"). sql/log_event.h: comment sql/mysql_priv.h: --log-bin-trust-routine-creators sql/mysqld.cc: --log-bin-trust-routine-creators sql/set_var.cc: --log-bin-trust-routine-creators sql/share/errmsg.txt: error messages to warn about problems with routines and binlog sql/slave.cc: If in a routine, replication table inclusion/exclusion rules always answer "replicate!" (see comment in code). sql/sp.cc: If binlog is on: errors if one wants to create a non-deterministic update routine (repeatability problem - note that the test is not perfect for functions) or does not have SUPER (because routines can easily be made to destroy slave's data with just CREATE ROUTINE and EXECUTE priv on master). --log-bin-trust-routine-creators removes these errors. Binlogging of CREATE PROCEDURE|FUNCTION. sql/sql_acl.cc: No thd==0 in tables_ok(). sql/sql_parse.cc: Binlogging of CALL (and not of the substatements of the SP). If SP returns error, we don't binlog it (see comment); we push warning in this case. Binlogging of ALTER|DROP PROCEDURE|FUNCTION with safety messages.
21 years ago
Fixed problems found by valgrind Fixed problems in test suite where some test failed Fixed access to not initialized memory in federated Fixed access to not initialized memory when using BIT fields in internal temporary tables BitKeeper/etc/ignore: added libmysqld/sql_cursor.h mysql-test/r/information_schema.result: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middlecd mysql-test/r/information_schema_inno.result: Remove used tables at start mysql-test/r/multi_statement.result: Remove used tables at start mysql-test/r/temp_table.result: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/r/type_bit.result: More tests mysql-test/t/information_schema.test: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/t/information_schema_inno.test: Remove used tables at start mysql-test/t/multi_statement.test: Remove used tables at start mysql-test/t/temp_table.test: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/t/type_bit.test: More tests mysql-test/valgrind.supp: Removed some valgrind warnings that isn't errors sql/ha_federated.cc: Fixed errors discovered by valgrind: - Socket was not initialized - share->scheme was deleted while there was still pointer into it from the hash sql/item_func.h: Remove access to table object from cleanup() as the table object may have been dropped earlier (In case of temporary tables or of close_thread_tables() is run before cleanup()) This fixed a bug with access to already freed memory sql/sql_base.cc: Reset variables used by fulltext sql/sql_select.cc: Fixed various problems with bit fields when used in internal temporary tables. Calculate space needed for bit fields correctly (previously we allocated more space than needed for rows in heap/myisam tables)
21 years ago
Approximative fixes for BUG#2610,2611,9100 i.e. WL#2146 binlogging/replication of routines (stored procs and functions). Approximative, because it's using our binlogging way (what we call "query"-level) and this is not as good as record-level binlog (5.1) would be. It imposes several limitations to routines, and has caveats (which I'll document, and for which the server will try to issue errors but that is not always possible). Reason I don't propagate caller info to the binlog as planned is that on master and slave users may be different; even with that some caveats would remain. mysql-test/mysql-test-run.sh: In the testsuite we know what we do, we are not creating nasty routines, and breaking binlog is ok except in rpl_sp. mysql-test/r/blackhole.result: Updating results now that 4.1 has been merged mysql-test/valgrind.supp: Some suppressions for Valgrind (useful on my machine Suse 9.1); this is just adding to the already existing suppressions of pthread and dl. sql/item_func.cc: Don't binlog the substatements when executing a function. If the function is declared to modify data and does not complete, warning "broken binlog". Note that SELECT myfunc() will not be binlogged even if myfunc() updates data (will be documented); but INSERT INTO t VALUES(myfunc()) will be binlogged (what decides is if the caller gets binlogged; the function changes nothing to binlogging). sql/log_event.cc: Just making functions which can be re-used when we binlog more strings in status_vars in Query_log_event (e.g. one day "user", "host"). sql/log_event.h: comment sql/mysql_priv.h: --log-bin-trust-routine-creators sql/mysqld.cc: --log-bin-trust-routine-creators sql/set_var.cc: --log-bin-trust-routine-creators sql/share/errmsg.txt: error messages to warn about problems with routines and binlog sql/slave.cc: If in a routine, replication table inclusion/exclusion rules always answer "replicate!" (see comment in code). sql/sp.cc: If binlog is on: errors if one wants to create a non-deterministic update routine (repeatability problem - note that the test is not perfect for functions) or does not have SUPER (because routines can easily be made to destroy slave's data with just CREATE ROUTINE and EXECUTE priv on master). --log-bin-trust-routine-creators removes these errors. Binlogging of CREATE PROCEDURE|FUNCTION. sql/sql_acl.cc: No thd==0 in tables_ok(). sql/sql_parse.cc: Binlogging of CALL (and not of the substatements of the SP). If SP returns error, we don't binlog it (see comment); we push warning in this case. Binlogging of ALTER|DROP PROCEDURE|FUNCTION with safety messages.
21 years ago
Fixed problems found by valgrind Fixed problems in test suite where some test failed Fixed access to not initialized memory in federated Fixed access to not initialized memory when using BIT fields in internal temporary tables BitKeeper/etc/ignore: added libmysqld/sql_cursor.h mysql-test/r/information_schema.result: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middlecd mysql-test/r/information_schema_inno.result: Remove used tables at start mysql-test/r/multi_statement.result: Remove used tables at start mysql-test/r/temp_table.result: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/r/type_bit.result: More tests mysql-test/t/information_schema.test: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/t/information_schema_inno.test: Remove used tables at start mysql-test/t/multi_statement.test: Remove used tables at start mysql-test/t/temp_table.test: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/t/type_bit.test: More tests mysql-test/valgrind.supp: Removed some valgrind warnings that isn't errors sql/ha_federated.cc: Fixed errors discovered by valgrind: - Socket was not initialized - share->scheme was deleted while there was still pointer into it from the hash sql/item_func.h: Remove access to table object from cleanup() as the table object may have been dropped earlier (In case of temporary tables or of close_thread_tables() is run before cleanup()) This fixed a bug with access to already freed memory sql/sql_base.cc: Reset variables used by fulltext sql/sql_select.cc: Fixed various problems with bit fields when used in internal temporary tables. Calculate space needed for bit fields correctly (previously we allocated more space than needed for rows in heap/myisam tables)
21 years ago
Fixed problems found by valgrind Fixed problems in test suite where some test failed Fixed access to not initialized memory in federated Fixed access to not initialized memory when using BIT fields in internal temporary tables BitKeeper/etc/ignore: added libmysqld/sql_cursor.h mysql-test/r/information_schema.result: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middlecd mysql-test/r/information_schema_inno.result: Remove used tables at start mysql-test/r/multi_statement.result: Remove used tables at start mysql-test/r/temp_table.result: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/r/type_bit.result: More tests mysql-test/t/information_schema.test: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/t/information_schema_inno.test: Remove used tables at start mysql-test/t/multi_statement.test: Remove used tables at start mysql-test/t/temp_table.test: Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle mysql-test/t/type_bit.test: More tests mysql-test/valgrind.supp: Removed some valgrind warnings that isn't errors sql/ha_federated.cc: Fixed errors discovered by valgrind: - Socket was not initialized - share->scheme was deleted while there was still pointer into it from the hash sql/item_func.h: Remove access to table object from cleanup() as the table object may have been dropped earlier (In case of temporary tables or of close_thread_tables() is run before cleanup()) This fixed a bug with access to already freed memory sql/sql_base.cc: Reset variables used by fulltext sql/sql_select.cc: Fixed various problems with bit fields when used in internal temporary tables. Calculate space needed for bit fields correctly (previously we allocated more space than needed for rows in heap/myisam tables)
21 years ago
  1. # Copyright (C) 2005, 2008 MySQL AB
  2. #
  3. # This program is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Library General Public
  5. # License as published by the Free Software Foundation; version 2
  6. # of the License.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. # Library General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU Library General Public
  14. # License along with this library; if not, write to the Free
  15. # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  16. # MA 02111-1307, USA
  17. #
  18. # Suppress some common (not fatal) errors in system libraries found by valgrind
  19. #
  20. #
  21. # Pthread doesn't free all thread specific memory before program exists
  22. #
  23. {
  24. pthread allocate_tls memory loss
  25. Memcheck:Leak
  26. fun:calloc
  27. fun:_dl_allocate_tls
  28. fun:allocate_stack
  29. fun:pthread_create*
  30. }
  31. {
  32. pthread allocate_tls memory loss
  33. Memcheck:Leak
  34. fun:calloc
  35. fun:_dl_allocate_tls
  36. fun:pthread_create*
  37. }
  38. {
  39. pthread allocate_dtv memory loss
  40. Memcheck:Leak
  41. fun:calloc
  42. fun:allocate_dtv
  43. fun:_dl_allocate_tls_storage
  44. fun:__GI__dl_allocate_tls
  45. fun:pthread_create
  46. }
  47. {
  48. pthread allocate_dtv memory loss second
  49. Memcheck:Leak
  50. fun:calloc
  51. fun:allocate_dtv
  52. fun:_dl_allocate_tls
  53. fun:pthread_create*
  54. }
  55. {
  56. pthread memalign memory loss
  57. Memcheck:Leak
  58. fun:memalign
  59. fun:_dl_allocate_tls_storage
  60. fun:__GI__dl_allocate_tls
  61. fun:pthread_create
  62. }
  63. {
  64. pthread pthread_key_create
  65. Memcheck:Leak
  66. fun:malloc
  67. fun:*
  68. fun:*
  69. fun:pthread_key_create
  70. fun:my_thread_global_init
  71. }
  72. {
  73. pthread strstr uninit
  74. Memcheck:Cond
  75. fun:strstr
  76. obj:/lib/tls/libpthread.so.*
  77. obj:/lib/tls/libpthread.so.*
  78. fun:call_init
  79. fun:_dl_init
  80. obj:/lib/ld-*.so
  81. }
  82. {
  83. pthread errno
  84. Memcheck:Leak
  85. fun:calloc
  86. fun:_dlerror_run
  87. fun:dlsym
  88. fun:__errno_location
  89. }
  90. #
  91. # Warnings in libz becasue it works with aligned memory(?)
  92. #
  93. {
  94. libz tr_flush_block
  95. Memcheck:Cond
  96. fun:_tr_flush_block
  97. fun:deflate_slow
  98. fun:deflate
  99. fun:do_flush
  100. fun:gzclose
  101. }
  102. {
  103. libz tr_flush_block2
  104. Memcheck:Cond
  105. fun:_tr_flush_block
  106. fun:deflate_slow
  107. fun:deflate
  108. fun:compress2
  109. }
  110. {
  111. libz longest_match
  112. Memcheck:Cond
  113. fun:longest_match
  114. fun:deflate_slow
  115. fun:deflate
  116. fun:do_flush
  117. }
  118. {
  119. libz longest_match2
  120. Memcheck:Cond
  121. fun:longest_match
  122. fun:deflate_slow
  123. fun:deflate
  124. fun:compress2
  125. }
  126. {
  127. libz longest_match 3
  128. Memcheck:Cond
  129. fun:longest_match
  130. fun:deflate_slow
  131. fun:deflate
  132. fun:gzclose
  133. }
  134. {
  135. libz longest_match 4
  136. Memcheck:Cond
  137. fun:longest_match
  138. fun:deflate_slow
  139. fun:deflate
  140. fun:gzflush
  141. }
  142. {
  143. libz deflate
  144. Memcheck:Cond
  145. obj:*/libz.so.*
  146. obj:*/libz.so.*
  147. fun:deflate
  148. fun:compress2
  149. }
  150. {
  151. libz deflate2
  152. Memcheck:Cond
  153. obj:*/libz.so.*
  154. obj:*/libz.so.*
  155. fun:deflate
  156. obj:*/libz.so.*
  157. fun:gzflush
  158. }
  159. #
  160. # Warning from my_thread_init becasue mysqld dies before kill thread exists
  161. #
  162. {
  163. my_thread_init kill thread memory loss second
  164. Memcheck:Leak
  165. fun:calloc
  166. fun:my_thread_init
  167. fun:kill_server_thread
  168. }
  169. #
  170. # Leaks reported in _dl_* internal functions on Linux amd64 / glibc2.3.2.
  171. #
  172. {
  173. _dl_start invalid write8
  174. Memcheck:Addr8
  175. fun:_dl_start
  176. }
  177. {
  178. _dl_start invalid write4
  179. Memcheck:Addr4
  180. fun:_dl_start
  181. }
  182. {
  183. _dl_start/_dl_setup_hash invalid read8
  184. Memcheck:Addr8
  185. fun:_dl_setup_hash
  186. fun:_dl_start
  187. }
  188. {
  189. _dl_sysdep_start invalid write8
  190. Memcheck:Addr8
  191. fun:_dl_sysdep_start
  192. }
  193. {
  194. _dl_init invalid write8
  195. Memcheck:Addr8
  196. fun:_dl_init
  197. }
  198. {
  199. _dl_init invalid write4
  200. Memcheck:Addr4
  201. fun:_dl_init
  202. }
  203. {
  204. _dl_init/_dl_init invalid read8
  205. Memcheck:Addr8
  206. fun:_dl_debug_initialize
  207. fun:_dl_init
  208. }
  209. {
  210. _dl_init/_dl_debug_state invalid read8
  211. Memcheck:Addr8
  212. fun:_dl_debug_state
  213. fun:_dl_init
  214. }
  215. {
  216. init invalid write8
  217. Memcheck:Addr8
  218. fun:init
  219. }
  220. {
  221. fixup invalid write8
  222. Memcheck:Addr8
  223. fun:fixup
  224. }
  225. {
  226. fixup/_dl_lookup_versioned_symbol invalid read8
  227. Memcheck:Addr8
  228. fun:_dl_lookup_versioned_symbol
  229. fun:fixup
  230. }
  231. {
  232. _dl_runtime_resolve invalid read8
  233. Memcheck:Addr8
  234. fun:_dl_runtime_resolve
  235. }
  236. {
  237. __libc_start_main invalid write8
  238. Memcheck:Addr8
  239. fun:__libc_start_main
  240. }
  241. {
  242. __libc_start_main/__sigjmp_save invalid write4
  243. Memcheck:Addr4
  244. fun:__sigjmp_save
  245. fun:__libc_start_main
  246. }
  247. #
  248. # These seem to be libc threading stuff, not related to MySQL code (allocations
  249. # during pthread_exit()). Googling shows other projects also using these
  250. # suppressions.
  251. #
  252. # Note that these all stem from pthread_exit() deeper in the call stack, but
  253. # Valgrind only allows the top four calls in the suppressions.
  254. #
  255. {
  256. libc pthread_exit 1
  257. Memcheck:Leak
  258. fun:malloc
  259. fun:_dl_new_object
  260. fun:_dl_map_object_from_fd
  261. fun:_dl_map_object
  262. }
  263. {
  264. libc pthread_exit 2
  265. Memcheck:Leak
  266. fun:malloc
  267. fun:_dl_map_object
  268. fun:dl_open_worker
  269. fun:_dl_catch_error
  270. }
  271. {
  272. libc pthread_exit 3
  273. Memcheck:Leak
  274. fun:malloc
  275. fun:_dl_map_object_deps
  276. fun:dl_open_worker
  277. fun:_dl_catch_error
  278. }
  279. {
  280. libc pthread_exit 4
  281. Memcheck:Leak
  282. fun:calloc
  283. fun:_dl_check_map_versions
  284. fun:dl_open_worker
  285. fun:_dl_catch_error
  286. }
  287. {
  288. libc pthread_exit 5
  289. Memcheck:Leak
  290. fun:calloc
  291. fun:_dl_new_object
  292. fun:_dl_map_object_from_fd
  293. fun:_dl_map_object
  294. }
  295. {
  296. libc pthread_exit 8
  297. Memcheck:Leak
  298. fun:malloc
  299. fun:local_strdup
  300. fun:_dl_map_object
  301. fun:dl_open_worker
  302. }
  303. #
  304. # This is seen internally in the system libraries on 64-bit RHAS3.
  305. #
  306. {
  307. __lll_mutex_unlock_wake uninitialized
  308. Memcheck:Param
  309. futex(utime)
  310. fun:__lll_mutex_unlock_wake
  311. }
  312. #
  313. # BUG#19940: NDB sends uninitialized parts of field buffers across the wire.
  314. # This is "works as designed"; the uninitialized part is not used at the
  315. # other end (but Valgrind cannot see this).
  316. #
  317. {
  318. bug19940
  319. Memcheck:Param
  320. socketcall.sendto(msg)
  321. fun:send
  322. fun:_ZN15TCP_Transporter6doSendEv
  323. fun:_ZN19TransporterRegistry11performSendEv
  324. fun:_ZN19TransporterRegistry14forceSendCheckEi
  325. }
  326. #
  327. # BUG#25463: Probable cause - slave thread doesn't have time to terminate properly
  328. # because rest of the server shuts down before that. The server shutdown code has
  329. # been fixed in 5.1 and there this leak should not happen. Suppression has been
  330. # approved by Monty.
  331. #
  332. # Important: do not propagate this rule to 5.1 tree!
  333. #
  334. {
  335. Slave thread shutdown (BUG#25463)
  336. Memcheck:Leak
  337. fun:calloc
  338. fun:my_thread_init
  339. fun:handle_slave_io
  340. }