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.

365 lines
5.7 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. #
  2. # Suppress some common (not fatal) errors in system libraries found by valgrind
  3. #
  4. #
  5. # Pthread doesn't free all thread specific memory before program exists
  6. #
  7. {
  8. pthread allocate_tls memory loss
  9. Memcheck:Leak
  10. fun:calloc
  11. fun:_dl_allocate_tls
  12. fun:allocate_stack
  13. fun:pthread_create*
  14. }
  15. {
  16. pthread allocate_tls memory loss
  17. Memcheck:Leak
  18. fun:calloc
  19. fun:_dl_allocate_tls
  20. fun:pthread_create*
  21. }
  22. {
  23. pthread allocate_dtv memory loss
  24. Memcheck:Leak
  25. fun:calloc
  26. fun:allocate_dtv
  27. fun:_dl_allocate_tls_storage
  28. fun:__GI__dl_allocate_tls
  29. fun:pthread_create
  30. }
  31. {
  32. pthread allocate_dtv memory loss second
  33. Memcheck:Leak
  34. fun:calloc
  35. fun:allocate_dtv
  36. fun:_dl_allocate_tls
  37. fun:pthread_create*
  38. }
  39. {
  40. pthread memalign memory loss
  41. Memcheck:Leak
  42. fun:memalign
  43. fun:_dl_allocate_tls_storage
  44. fun:__GI__dl_allocate_tls
  45. fun:pthread_create
  46. }
  47. {
  48. pthread pthread_key_create
  49. Memcheck:Leak
  50. fun:malloc
  51. fun:*
  52. fun:*
  53. fun:pthread_key_create
  54. fun:my_thread_global_init
  55. }
  56. {
  57. pthread strstr uninit
  58. Memcheck:Cond
  59. fun:strstr
  60. obj:/lib/tls/libpthread.so.*
  61. obj:/lib/tls/libpthread.so.*
  62. fun:call_init
  63. fun:_dl_init
  64. obj:/lib/ld-*.so
  65. }
  66. {
  67. pthread errno
  68. Memcheck:Leak
  69. fun:calloc
  70. fun:_dlerror_run
  71. fun:dlsym
  72. fun:__errno_location
  73. }
  74. #
  75. # Warnings in libz becasue it works with aligned memory(?)
  76. #
  77. {
  78. libz tr_flush_block
  79. Memcheck:Cond
  80. fun:_tr_flush_block
  81. fun:deflate_slow
  82. fun:deflate
  83. fun:do_flush
  84. fun:gzclose
  85. }
  86. {
  87. libz tr_flush_block2
  88. Memcheck:Cond
  89. fun:_tr_flush_block
  90. fun:deflate_slow
  91. fun:deflate
  92. fun:compress2
  93. }
  94. {
  95. libz longest_match
  96. Memcheck:Cond
  97. fun:longest_match
  98. fun:deflate_slow
  99. fun:deflate
  100. fun:do_flush
  101. }
  102. {
  103. libz longest_match2
  104. Memcheck:Cond
  105. fun:longest_match
  106. fun:deflate_slow
  107. fun:deflate
  108. fun:compress2
  109. }
  110. {
  111. libz longest_match 3
  112. Memcheck:Cond
  113. fun:longest_match
  114. fun:deflate_slow
  115. fun:deflate
  116. fun:gzclose
  117. }
  118. {
  119. libz longest_match 4
  120. Memcheck:Cond
  121. fun:longest_match
  122. fun:deflate_slow
  123. fun:deflate
  124. fun:gzflush
  125. }
  126. {
  127. libz deflate
  128. Memcheck:Cond
  129. obj:*/libz.so.*
  130. obj:*/libz.so.*
  131. fun:deflate
  132. fun:compress2
  133. }
  134. {
  135. libz deflate2
  136. Memcheck:Cond
  137. obj:*/libz.so.*
  138. obj:*/libz.so.*
  139. fun:deflate
  140. obj:*/libz.so.*
  141. fun:gzflush
  142. }
  143. #
  144. # Warning from my_thread_init becasue mysqld dies before kill thread exists
  145. #
  146. {
  147. my_thread_init kill thread memory loss second
  148. Memcheck:Leak
  149. fun:calloc
  150. fun:my_thread_init
  151. fun:kill_server_thread
  152. }
  153. #
  154. # Leaks reported in _dl_* internal functions on Linux amd64 / glibc2.3.2.
  155. #
  156. {
  157. _dl_start invalid write8
  158. Memcheck:Addr8
  159. fun:_dl_start
  160. }
  161. {
  162. _dl_start invalid write4
  163. Memcheck:Addr4
  164. fun:_dl_start
  165. }
  166. {
  167. _dl_start/_dl_setup_hash invalid read8
  168. Memcheck:Addr8
  169. fun:_dl_setup_hash
  170. fun:_dl_start
  171. }
  172. {
  173. _dl_sysdep_start invalid write8
  174. Memcheck:Addr8
  175. fun:_dl_sysdep_start
  176. }
  177. {
  178. _dl_init invalid write8
  179. Memcheck:Addr8
  180. fun:_dl_init
  181. }
  182. {
  183. _dl_init invalid write4
  184. Memcheck:Addr4
  185. fun:_dl_init
  186. }
  187. {
  188. _dl_init/_dl_init invalid read8
  189. Memcheck:Addr8
  190. fun:_dl_debug_initialize
  191. fun:_dl_init
  192. }
  193. {
  194. _dl_init/_dl_debug_state invalid read8
  195. Memcheck:Addr8
  196. fun:_dl_debug_state
  197. fun:_dl_init
  198. }
  199. {
  200. init invalid write8
  201. Memcheck:Addr8
  202. fun:init
  203. }
  204. {
  205. fixup invalid write8
  206. Memcheck:Addr8
  207. fun:fixup
  208. }
  209. {
  210. fixup/_dl_lookup_versioned_symbol invalid read8
  211. Memcheck:Addr8
  212. fun:_dl_lookup_versioned_symbol
  213. fun:fixup
  214. }
  215. {
  216. _dl_runtime_resolve invalid read8
  217. Memcheck:Addr8
  218. fun:_dl_runtime_resolve
  219. }
  220. {
  221. __libc_start_main invalid write8
  222. Memcheck:Addr8
  223. fun:__libc_start_main
  224. }
  225. {
  226. __libc_start_main/__sigjmp_save invalid write4
  227. Memcheck:Addr4
  228. fun:__sigjmp_save
  229. fun:__libc_start_main
  230. }
  231. #
  232. # These seem to be libc threading stuff, not related to MySQL code (allocations
  233. # during pthread_exit()). Googling shows other projects also using these
  234. # suppressions.
  235. #
  236. # Note that these all stem from pthread_exit() deeper in the call stack, but
  237. # Valgrind only allows the top four calls in the suppressions.
  238. #
  239. {
  240. libc pthread_exit 1
  241. Memcheck:Leak
  242. fun:malloc
  243. fun:_dl_new_object
  244. fun:_dl_map_object_from_fd
  245. fun:_dl_map_object
  246. }
  247. {
  248. libc pthread_exit 2
  249. Memcheck:Leak
  250. fun:malloc
  251. fun:_dl_map_object
  252. fun:dl_open_worker
  253. fun:_dl_catch_error
  254. }
  255. {
  256. libc pthread_exit 3
  257. Memcheck:Leak
  258. fun:malloc
  259. fun:_dl_map_object_deps
  260. fun:dl_open_worker
  261. fun:_dl_catch_error
  262. }
  263. {
  264. libc pthread_exit 4
  265. Memcheck:Leak
  266. fun:calloc
  267. fun:_dl_check_map_versions
  268. fun:dl_open_worker
  269. fun:_dl_catch_error
  270. }
  271. {
  272. libc pthread_exit 5
  273. Memcheck:Leak
  274. fun:calloc
  275. fun:_dl_new_object
  276. fun:_dl_map_object_from_fd
  277. fun:_dl_map_object
  278. }
  279. #
  280. # This is seen internally in the system libraries on 64-bit RHAS3.
  281. #
  282. {
  283. __lll_mutex_unlock_wake uninitialized
  284. Memcheck:Param
  285. futex(utime)
  286. fun:__lll_mutex_unlock_wake
  287. }
  288. #
  289. # BUG#19940: NDB sends uninitialized parts of field buffers across the wire.
  290. # This is "works as designed"; the uninitialized part is not used at the
  291. # other end (but Valgrind cannot see this).
  292. #
  293. {
  294. bug19940
  295. Memcheck:Param
  296. socketcall.sendto(msg)
  297. fun:send
  298. fun:_ZN15TCP_Transporter6doSendEv
  299. fun:_ZN19TransporterRegistry11performSendEv
  300. fun:_ZN19TransporterRegistry14forceSendCheckEi
  301. }
  302. #
  303. # BUG#25463: Probable cause - slave thread doesn't have time to terminate properly
  304. # because rest of the server shuts down before that. The server shutdown code has
  305. # been fixed in 5.1 and there this leak should not happen. Suppression has been
  306. # approved by Monty.
  307. #
  308. # Important: do not propagate this rule to 5.1 tree!
  309. #
  310. {
  311. Slave thread shutdown (BUG#25463)
  312. Memcheck:Leak
  313. fun:calloc
  314. fun:my_thread_init
  315. fun:handle_slave_io
  316. }