{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/mysql-5.6/issues/254","repository_url":"https://api.github.com/repos/facebook/mysql-5.6","labels_url":"https://api.github.com/repos/facebook/mysql-5.6/issues/254/labels{/name}","comments_url":"https://api.github.com/repos/facebook/mysql-5.6/issues/254/comments","events_url":"https://api.github.com/repos/facebook/mysql-5.6/issues/254/events","html_url":"https://github.com/facebook/mysql-5.6/issues/254","id":156076136,"number":254,"title":"False alarm with gap_lock_raise_error","user":{"login":"yoshinorim","id":253614,"avatar_url":"https://avatars.githubusercontent.com/u/253614?v=3","gravatar_id":"","url":"https://api.github.com/users/yoshinorim","html_url":"https://github.com/yoshinorim","followers_url":"https://api.github.com/users/yoshinorim/followers","following_url":"https://api.github.com/users/yoshinorim/following{/other_user}","gists_url":"https://api.github.com/users/yoshinorim/gists{/gist_id}","starred_url":"https://api.github.com/users/yoshinorim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoshinorim/subscriptions","organizations_url":"https://api.github.com/users/yoshinorim/orgs","repos_url":"https://api.github.com/users/yoshinorim/repos","events_url":"https://api.github.com/users/yoshinorim/events{/privacy}","received_events_url":"https://api.github.com/users/yoshinorim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/mysql-5.6/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/facebook/mysql-5.6/labels/high-pri","name":"high-pri","color":"5319e7"},{"url":"https://api.github.com/repos/facebook/mysql-5.6/labels/myrocks","name":"myrocks","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-21T01:14:15Z","updated_at":"2016-05-24T00:33:12Z","closed_at":"2016-05-24T00:33:12Z","body":"This is related to #163. Queries unexpectedly using temporary tables returning gap lock alerts if gap_lock_raise_error is enabled.\r\n\r\nHow to repeat:\r\n```\r\ncreate table t (id int primary key, value int);\r\nset session gap_lock_raise_error=1; begin; update t set value=100 where id in (1, 2);\r\n```\r\n\r\nThe error was from init_read_record() in sql/records.cc:238.\r\n```\r\n  if (tempfile && my_b_inited(tempfile)) // Test if ref-records was used\r\n  {\r\n    DBUG_PRINT(\"info\",(\"using rr_from_tempfile\"));\r\n    info->read_record= (table->sort.addon_field ?\r\n                        rr_unpack_from_tempfile : rr_from_tempfile);\r\n    info->io_cache=tempfile;\r\n    reinit_io_cache(info->io_cache,READ_CACHE,0L,0,0);\r\n    info->ref_pos=table->file->ref;\r\n    if (!table->file->inited &&\r\n        (error= table->file->ha_rnd_init(0)))\r\n      goto err;\r\n```\r\nha_rnd_init() calls handler::is_using_prohibited_gap_locks(). handler::is_using_prohibited_gap_locks() checks if ht->db_type is innodb or rocksdb. In this case db_type was same as the original table, not temporary table types (MyISAM/HEAP). So it matched the error condition.\r\n\r\n"}}
{"actor":{"display_login":"yoshinorim"}}