# 创建表的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 自定义插件调试的更多相关文章

  1. Cordova应用的JavaScript代码和自定义插件代码的调试

    我之前写过三篇Cordova相关的技术文章.当我们使用Cordova将自己开发的前端应用打包安装到手机上后,可能会遇到需要调试Cordova应用的时候. 本文就介绍Cordova应用的调试步骤. 如果 ...

  2. ionic3使用cordova创建自定义插件

    1 安装 plugman 插件 npm --registry https://registry.npm.taobao.org install -g plugman 2 新建组件 新建一个插件文件夹,进 ...

  3. Mybatis框架(9)---Mybatis自定义插件生成雪花ID做为表主键项目

    Mybatis自定义插件生成雪花ID做为主键项目 先附上项目项目GitHub地址 spring-boot-mybatis-interceptor 有关Mybatis雪花ID主键插件前面写了两篇博客作为 ...

  4. 基于JRebel开发的MySQL Explain插件

    前言 我们在使用数据库时,为了使业务系统性能达到最优,往往都需要避免慢SQL查询,不能等到线上告警了再排查是否为慢SQL导致.在开发阶段,每个开发人员就应该针对自己写的SQL看是否可能为慢SQL,从而 ...

  5. Airflow自定义插件, 使用datax抽数

    Airflow之所以受欢迎的一个重要因素就是它的插件机制.Python成熟类库可以很方便的引入各种插件.在我们实际工作中,必然会遇到官方的一些插件不足够满足需求的时候.这时候,我们可以编写自己的插件. ...

  6. mybaits源码分析--自定义插件(七)

    一.MyBatis插件 插件是一种常见的扩展方式,大多数开源框架也都支持用户通过添加自定义插件的方式来扩展或者改变原有的功能,MyBatis中也提供的有插件,虽然叫插件,但是实际上是通过拦截器(Int ...

  7. 深入学习jQuery自定义插件

    原文地址:jQuery自定义插件学习 1.定义插件的方法 对象级别的插件扩展,即为jQuery类的实例增加方法, 调用:$(选择器).函数名(参数);      $(‘#id’).myPlugin(o ...

  8. mysql 自定义函数

    原文:http://www.cnblogs.com/zhangminghui/p/4113160.html 引言 MySQL本身提供了内置函数,这些函数的存在给我们日常的开发和数据操作带来了很大的便利 ...

  9. jquery自定义插件结合baiduTemplate.js实现异步刷新(附源码)

    上一篇记录了BaiduTemplate模板引擎使用示例附源码,在此基础上对使用方法进行了封装 自定义插件jajaxrefresh.js 代码如下: //闭包限定命名空间 (function ($) { ...

随机推荐

  1. 利用 html js判断 客户端是否安装了某个app 安装了就打开 否则跳转到gp

    三种方式 方式一:简单的进行打开app,延时操作若未打开直接跳gp function isInstalled(){ var urlFrag = 'somepars'; var the_href = ' ...

  2. postman工具的使用

    https://www.cnblogs.com/rookie-c/p/5753948.html#4100341 https://www.jellythink.com/archives/category ...

  3. class的真相

    Java中Class类及用法 Java程序在运行时,Java运行时系统一直对所有的对象进行所谓的运行时类型标识,即所谓的RTTI.这项信息纪录了每个对象所属的类.虚拟机通常使用运行时类型信息选准正确方 ...

  4. mfc动态控件生成

    1.变量.函数声明 std::vector<CButton*>pBtn; afx void OnBtnClik(UINT uID);//回调函数 2.分配空间 pBtn.resize(50 ...

  5. L1,L2正则化代码

    # L1正则 import numpy as np from sklearn.linear_model import Lasso from sklearn.linear_model import SG ...

  6. luoguP1919 A*B Problem升级版 ntt

    luoguP1919 A*B Problem升级版 链接 luogu 思路 ntt模板题 代码 #include <bits/stdc++.h> #define ll long long ...

  7. 使用telnet进行Dubbo接口测试

    telnet进入dubbo 查看pid $ jps -l 26048 org.apache.catalina.startup.Bootstrap 12388 org.jetbrains.jps.cmd ...

  8. 让Visualstudio在win10下使用管理员方式运行

    https://www.cnblogs.com/zhaogaojian/p/10124629.html vs右键高级设置管理员运行后,每次直接运行使用的是管理员方式,但是如果直接在sln文件上点击使用 ...

  9. 【ASP.NET】 HttpContext.Current.User.Identity.Name 返回值为空

    问题起因 在做项目的时候,我使用HttpContext.Current.User.Identity.Name来获取Web应用程序正在使用时的用户名. 在开发过程中,我使用了我的本地iis,启用了集成的 ...

  10. LINUX之根目录介绍、普通目录创建、删除、复制、移动、权限管理命令记录

    (一)Linux 系统目录结构 登录系统后,在当前命令窗口下输入命令:ls / /bin:bin是Binary的缩写, 这个目录存放着最经常使用的命令. /boot:这里存放的是启动Linux时使用的 ...