mysql 自定义插件调试
# 创建表的stack
frame #0: 0x000000011d11f58a ha_spartan.so`Spartan_data::create_table(this=0x00007f9fc1311c40, path="./test/testarc.sde") + 74 at spartan_data.cc:32
frame #1: 0x000000011d11dded ha_spartan.so`ha_spartan::create(this=0x00007f9fc1314b70, name="./test/testarc", table_arg=0x000070000fd97778, create_info=0x000070000fd9b2f8) + 269 at ha_spartan.cc:923
frame #2: 0x000000010fe6e416 mysqld`handler::ha_create(this=0x00007f9fc1314b70, name="./test/testarc", form=0x000070000fd97778, info=0x000070000fd9b2f8) + 118 at handler.cc:4526
frame #3: 0x000000010fe6ed6f mysqld`ha_create_table(thd=0x00007f9fc0060a00, path="./test/testarc", db="test", table_name="testarc", create_info=0x000070000fd9b2f8, update_create_info=false, is_temp_table=false) + 831 at handler.cc:4770
frame #4: 0x000000011025a877 mysqld`rea_create_table(thd=0x00007f9fc0060a00, path="./test/testarc", db="test", table_name="testarc", create_info=0x000070000fd9b2f8, create_fields=0x000070000fd9b2b0, keys=0, key_info=0x00007f9fbf09d520, file=0x00007f9fbf09d2d0, no_ha_table=false) + 551 at unireg.cc:546
frame #5: 0x00000001101cd650 mysqld`create_table_impl(thd=0x00007f9fc0060a00, db="test", table_name="testarc", error_table_name="testarc", path="./test/testarc", create_info=0x000070000fd9b2f8, alter_info=0x000070000fd9b268, internal_tmp_table=false, select_field_count=0, no_ha_table=false, is_trans=0x000070000fd9a25e, key_info=0x000070000fd99f88, key_count=0x000070000fd99f84) + 5232 at sql_table.cc:5009
frame #6: 0x00000001101cc13a mysqld`mysql_create_table_no_lock(thd=0x00007f9fc0060a00, db="test", table_name="testarc", create_info=0x000070000fd9b2f8, alter_info=0x000070000fd9b268, select_field_count=0, is_trans=0x000070000fd9a25e) + 506 at sql_table.cc:5125
frame #7: 0x00000001101cdb60 mysqld`mysql_create_table(thd=0x00007f9fc0060a00, create_table=0x00007f9fbf09c748, create_info=0x000070000fd9b2f8, alter_info=0x000070000fd9b268) + 272 at sql_table.cc:5174
frame #8: 0x000000011011bc59 mysqld`mysql_execute_command(thd=0x00007f9fc0060a00) + 9673 at sql_parse.cc:3136
frame #9: 0x0000000110117ba0 mysqld`mysql_parse(thd=0x00007f9fc0060a00, rawbuf="CREATE TABLE testarc (a int, b varchar(20), c int) ENGINE=SPARTAN", length=65, parser_state=0x000070000fd9d380) + 1376 at sql_parse.cc:6422
frame #10: 0x00000001101144cf mysqld`dispatch_command(command=COM_QUERY, thd=0x00007f9fc0060a00, packet="CREATE TABLE testarc (a int, b varchar(20), c int) ENGINE=SPARTAN", packet_length=65) + 4367 at sql_parse.cc:1399
frame #11: 0x00000001101170bb mysqld`do_command(thd=0x00007f9fc0060a00) + 875 at sql_parse.cc:1064
frame #12: 0x000000011009a562 mysqld`do_handle_one_connection(thd_arg=0x00007f9fc0060a00) + 498 at sql_connect.cc:982
frame #13: 0x000000011009a30d mysqld`::handle_one_connection(arg=0x00007f9fc0060a00) + 45 at sql_connect.cc:899
frame #14: 0x0000000110773bdd mysqld`::pfs_spawn_thread(arg=0x00007f9fc17736e0) + 333 at pfs.cc:1861
frame #15: 0x00007fff9458993b libsystem_pthread.dylib`_pthread_body + 180
frame #16: 0x00007fff94589887 libsystem_pthread.dylib`_pthread_start + 286
frame #17: 0x00007fff9458908d libsystem_pthread.dylib`thread_start + 13
# 创建表
(lldb) bt
(lldb) bt
* thread #22: tid = 0xcfa54, 0x000000011d11ef2b ha_spartan.so`spartan_create_handler(hton=0x00007f9fc1416490, table=0x0000000000000000, mem_root=0x00007f9fc0063af0) + 27 at ha_spartan.cc:102, stop reason = step in
* frame #0: 0x000000011d11ef2b ha_spartan.so`spartan_create_handler(hton=0x00007f9fc1416490, table=0x0000000000000000, mem_root=0x00007f9fc0063af0) + 27 at ha_spartan.cc:102
frame #1: 0x000000010fe6296b mysqld`get_new_handler(share=0x0000000000000000, alloc=0x00007f9fc0063af0, db_type=0x00007f9fc1416490) + 203 at handler.cc:442
frame #2: 0x00000001101cc47f mysqld`create_table_impl(thd=0x00007f9fc0060a00, db="test", table_name="testarc1", error_table_name="testarc1", path="./test/testarc1", create_info=0x000070000fd9b2f8, alter_info=0x000070000fd9b268, internal_tmp_table=false, select_field_count=0, no_ha_table=false, is_trans=0x000070000fd9a25e, key_info=0x000070000fd99f88, key_count=0x000070000fd99f84) + 671 at sql_table.cc:4640
frame #3: 0x00000001101cc13a mysqld`mysql_create_table_no_lock(thd=0x00007f9fc0060a00, db="test", table_name="testarc1", create_info=0x000070000fd9b2f8, alter_info=0x000070000fd9b268, select_field_count=0, is_trans=0x000070000fd9a25e) + 506 at sql_table.cc:5125
frame #4: 0x00000001101cdb60 mysqld`mysql_create_table(thd=0x00007f9fc0060a00, create_table=0x00007f9fbf09c758, create_info=0x000070000fd9b2f8, alter_info=0x000070000fd9b268) + 272 at sql_table.cc:5174
frame #5: 0x000000011011bc59 mysqld`mysql_execute_command(thd=0x00007f9fc0060a00) + 9673 at sql_parse.cc:3136
frame #6: 0x0000000110117ba0 mysqld`mysql_parse(thd=0x00007f9fc0060a00, rawbuf="CREATE TABLE testarc1 (a int, b varchar(20), c int) ENGINE=SPARTAN", length=66, parser_state=0x000070000fd9d380) + 1376 at sql_parse.cc:6422
frame #7: 0x00000001101144cf mysqld`dispatch_command(command=COM_QUERY, thd=0x00007f9fc0060a00, packet="CREATE TABLE testarc1 (a int, b varchar(20), c int) ENGINE=SPARTAN", packet_length=66) + 4367 at sql_parse.cc:1399
frame #8: 0x00000001101170bb mysqld`do_command(thd=0x00007f9fc0060a00) + 875 at sql_parse.cc:1064
frame #9: 0x000000011009a562 mysqld`do_handle_one_connection(thd_arg=0x00007f9fc0060a00) + 498 at sql_connect.cc:982
frame #10: 0x000000011009a30d mysqld`::handle_one_connection(arg=0x00007f9fc0060a00) + 45 at sql_connect.cc:899
frame #11: 0x0000000110773bdd mysqld`::pfs_spawn_thread(arg=0x00007f9fc17736e0) + 333 at pfs.cc:1861
frame #12: 0x00007fff9458993b libsystem_pthread.dylib`_pthread_body + 180
frame #13: 0x00007fff94589887 libsystem_pthread.dylib`_pthread_start + 286
frame #14: 0x00007fff9458908d libsystem_pthread.dylib`thread_start + 13
获取handler
static int spartan_init_func(void *p)
{
DBUG_ENTER("spartan_init_func"); #ifdef HAVE_PSI_INTERFACE
init_spartan_psi_keys();
#endif spartan_hton= (handlerton *)p;
spartan_hton->state= SHOW_OPTION_YES;
spartan_hton->create= spartan_create_handler;
spartan_hton->flags= HTON_CAN_RECREATE;
spartan_hton->system_database= spartan_system_database;
spartan_hton->is_supported_system_table= spartan_is_supported_system_table; DBUG_RETURN(0);
} mysql_declare_plugin(spartan)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
&spartan_storage_engine,
"SPARTAN",
"jishu",
"demo storage engine",
PLUGIN_LICENSE_GPL,
spartan_init_func, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0001 /* 0.1 */,
func_status, /* status variables */
spartan_system_variables, /* system variables */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;
handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
handlerton *db_type)
{
handler *file;
DBUG_ENTER("get_new_handler");
DBUG_PRINT("enter", ("alloc: 0x%lx", (long) alloc)); if (db_type && db_type->state == SHOW_OPTION_YES && db_type->create)
{
if ((file= db_type->create(db_type, share, alloc)))
file->init();
DBUG_RETURN(file);
}
/*
Try the default table type
Here the call to current_thd() is ok as we call this function a lot of
times but we enter this branch very seldom.
*/
DBUG_RETURN(get_new_handler(share, alloc, ha_default_handlerton(current_thd)));
}
# db 类型
create_table_option:
ENGINE_SYM opt_equal storage_engines
{
Lex->create_info.db_type= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
} storage_engines:
ident_or_text
{
THD *thd= YYTHD;
plugin_ref plugin=
ha_resolve_by_name(thd, &$,
thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE); if (plugin)
$$= plugin_data(plugin, handlerton*);
else
{
if (thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
{
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(), $.str);
MYSQL_YYABORT;
}
$$= ;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_UNKNOWN_STORAGE_ENGINE,
ER(ER_UNKNOWN_STORAGE_ENGINE),
$.str);
}
}
;
# 新增的断点
: name = 'ha_spartan::create', locations = (pending) : name = 'create', locations = (pending) : file = 'ha_spartan.cc', line = , exact_match = , locations = , resolved = , hit count =
3.1: where = ha_spartan.so`ha_spartan::create(char const*, TABLE*, st_ha_create_information*) + at ha_spartan.cc:, address = 0x000000011d11dd4f, resolved, hit count = : file = 'ha_spartan.cc', line = , exact_match = , locations = , resolved = , hit count =
4.1: where = ha_spartan.so`ha_spartan::create(char const*, TABLE*, st_ha_create_information*) + at ha_spartan.cc:, address = 0x000000011d11dd4f, resolved, hit count = : file = 'ha_spartan.cc', line = , exact_match = , locations = , resolved = , hit count =
5.1: where = ha_spartan.so`ha_spartan::create(char const*, TABLE*, st_ha_create_information*) + at ha_spartan.cc:, address = 0x000000011d11dd4f, resolved, hit count = : file = 'ha_spartan.cc', line = , exact_match = , locations = , resolved = , hit count =
6.1: where = ha_spartan.so`ha_spartan::create(char const*, TABLE*, st_ha_create_information*) + at ha_spartan.cc:, address = 0x000000011d11dd4f, resolved, hit count = : name = 'ha_spartan::get_share', locations = , resolved = , hit count =
7.1: where = ha_spartan.so`ha_spartan::get_share() + at ha_spartan.cc:, address = 0x000000011d11c7a7, resolved, hit count = : name = 'create_table_impl', locations = , resolved = , hit count =
8.1: where = mysqld`create_table_impl(THD*, char const*, char const*, char const*, char const*, st_ha_create_information*, Alter_info*, bool, unsigned int, bool, bool*, st_key**, unsigned int*) + at sql_table.cc:, address = 0x00000001101cc2c2, resolved, hit count = : name = 'ha_create_table', locations = , resolved = , hit count =
9.1: where = mysqld`ha_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, bool, bool) + at handler.cc:, address = 0x000000010fe6ea8e, resolved, hit count = : name = 'open_table_from_share', locations = , resolved = , hit count =
10.1: where = mysqld`open_table_from_share(THD*, TABLE_SHARE*, char const*, unsigned int, unsigned int, unsigned int, TABLE*, bool) + at table.cc:, address = 0x000000011023d652, resolved, hit count = : name = 'get_new_handler', locations = , resolved = , hit count =
11.1: where = mysqld`get_new_handler(TABLE_SHARE*, st_mem_root*, handlerton*) + at handler.cc:, address = 0x000000010fe628cc, resolved, hit count =
11.2: where = libc++abi.dylib`std::get_new_handler(), address = 0x00007fff92f25de3, resolved, hit count = : name = 'spartan_create_handler', locations = , resolved = , hit count =
12.1: where = ha_spartan.so`spartan_create_handler(handlerton*, TABLE_SHARE*, st_mem_root*) + at ha_spartan.cc:, address = 0x000000011d11ef2b, resolved, hit count = : name = 'ha_resolve_by_name', locations = , resolved = , hit count =
13.1: where = mysqld`ha_resolve_by_name(THD*, st_mysql_lex_string const*, bool) + at handler.cc:, address = 0x000000010fe62387, resolved, hit count =
mysql 自定义插件调试的更多相关文章
- Cordova应用的JavaScript代码和自定义插件代码的调试
我之前写过三篇Cordova相关的技术文章.当我们使用Cordova将自己开发的前端应用打包安装到手机上后,可能会遇到需要调试Cordova应用的时候. 本文就介绍Cordova应用的调试步骤. 如果 ...
- ionic3使用cordova创建自定义插件
1 安装 plugman 插件 npm --registry https://registry.npm.taobao.org install -g plugman 2 新建组件 新建一个插件文件夹,进 ...
- Mybatis框架(9)---Mybatis自定义插件生成雪花ID做为表主键项目
Mybatis自定义插件生成雪花ID做为主键项目 先附上项目项目GitHub地址 spring-boot-mybatis-interceptor 有关Mybatis雪花ID主键插件前面写了两篇博客作为 ...
- 基于JRebel开发的MySQL Explain插件
前言 我们在使用数据库时,为了使业务系统性能达到最优,往往都需要避免慢SQL查询,不能等到线上告警了再排查是否为慢SQL导致.在开发阶段,每个开发人员就应该针对自己写的SQL看是否可能为慢SQL,从而 ...
- Airflow自定义插件, 使用datax抽数
Airflow之所以受欢迎的一个重要因素就是它的插件机制.Python成熟类库可以很方便的引入各种插件.在我们实际工作中,必然会遇到官方的一些插件不足够满足需求的时候.这时候,我们可以编写自己的插件. ...
- mybaits源码分析--自定义插件(七)
一.MyBatis插件 插件是一种常见的扩展方式,大多数开源框架也都支持用户通过添加自定义插件的方式来扩展或者改变原有的功能,MyBatis中也提供的有插件,虽然叫插件,但是实际上是通过拦截器(Int ...
- 深入学习jQuery自定义插件
原文地址:jQuery自定义插件学习 1.定义插件的方法 对象级别的插件扩展,即为jQuery类的实例增加方法, 调用:$(选择器).函数名(参数); $(‘#id’).myPlugin(o ...
- mysql 自定义函数
原文:http://www.cnblogs.com/zhangminghui/p/4113160.html 引言 MySQL本身提供了内置函数,这些函数的存在给我们日常的开发和数据操作带来了很大的便利 ...
- jquery自定义插件结合baiduTemplate.js实现异步刷新(附源码)
上一篇记录了BaiduTemplate模板引擎使用示例附源码,在此基础上对使用方法进行了封装 自定义插件jajaxrefresh.js 代码如下: //闭包限定命名空间 (function ($) { ...
随机推荐
- Python爬虫与一汽项目【一】爬取中海油,邮政,国家电网问题总结
项目介绍 中国海洋石油是爬取的第一个企业,之后依次爬取了,国家电网,中国邮政,这三家公司的源码并没有多大难度, 采购信息地址: 国家电网电子商务平台 http://ecp.sgcc.com.cn/pr ...
- fiddler 抓包工具(新猿旺学习总结)
安装抓包工具 Fiddler 直接安装 fiddler下载连接:https://www.lanzous.com/i30k09c 设置 fiddler 因为 r fiddler 是抓取 P HTTP 和 ...
- C sharp #001# hello world
饮水思源:金老师的自学网站 索引 编写一个简单的控制台程序. 日期计算的结构化编程实现 日期计算机面向对象编程实现 直接应用已有组件 1.编写一个简单的控制台程序. using System; usi ...
- websocket flutter
https://stackoverflow.com/questions/51077233/how-can-i-use-socket-in-flutter-app import 'dart:io'; i ...
- win7有多条隧道适配器(isatap、teredo、6to4)的原因及关闭方法
问题:sdp协商时,带有IPV6的信息,需要将IPV6相关信息去掉 原因:网卡启用了ipv6通道 解决:关闭IPv6数据接口 netsh interface isatap set state disa ...
- 14: linux实用命令
1.1 基本实用命令整理 1.查找大文件文件 du -sh ./*|grep G # 查看当前目录下个文件大于1G的文件夹 2.查找日志文件中 5xx数量,并进行排序 ...
- Python网络爬虫入门篇
1. 预备知识 学习者需要预先掌握Python的数字类型.字符串类型.分支.循环.函数.列表类型.字典类型.文件和第三方库使用等概念和编程方法. 2. Python爬虫基本流程 a. 发送请求 使用 ...
- 第一次跑eureka
- mongodb常用的sql语句总结
本文为博主原创,转载请注明出处: 1 . 查询所有 db.getCollection('CollectionName').find() 2.根据条件查询 db.getCollection('Coll ...
- vue--vant组件库field输入框
安装vant UI框架: cnpm install vant –-save-dev 导入组件-在main.js里: import Vant from 'vant'; import'vant/lib/v ...