# 创建表的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. XPosed 示例

    https://blog.csdn.net/fmc088/article/details/80535894

  2. Oracle错误——tablespace 'XXXX' does not exist

    错误 在使用IMP命令导入Oracle数据的时候,因为导出数据的数据库表空间和导入数据的数据库表空间不同,导致导入数据失败,出现:tablespace 'XXXX' does not exist 在网 ...

  3. Python3 tkinter基础 Radiobutton 创建三个单选钮

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  4. AI_群组行为

    using System.Collections.Generic; using UnityEngine; public class CrowAI : MonoBehaviour { //当前速度 ; ...

  5. 【使用指南】ComponentOne Enterprise .NET开发控件集

    为方便广大 .NET开发人员更好的使用 ComponentOne Enterprise .NET开发控件集,葡萄城专门推出了 ComponentOne Enterprise 使用指南,该指南详细地介绍 ...

  6. python程序—封装案例

    需求: 1.房子有户型.总面积.家具名称列表 房子没有任何家具 2.家具有名字和占地面积,其中 席梦思(bed):4平米 衣柜(chest): 2平米 餐桌(table): 1.5平米 3.将以上3个 ...

  7. python-Word模板填充-docxtpl

    docxtpl 按指定的word模板填充内容 安装 pip install docxtpl 示例 from docxtpl import DocxTemplate data_dic = { 't1': ...

  8. Vue-admin工作整理(五):守卫导航

    一.作用: 它可以帮我们在路由发生跳转,到导航结束的时间内,做一些相应的逻辑处理,分为:全局守卫,和专项守卫 1.全局收尾: (a).前置守卫:router.beforeEach(to,from,ne ...

  9. Poj2018 Best Cow Fences

    传送门 题目大意就是给定一个长度为 n 的正整数序列 A ,求一个平均数最大的,长度不小于 L 的子序列. 思路: 二分答案. Code: #include<iostream> #incl ...

  10. pta

    一:实验代码 include <stdio.h> char theValue[10] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j ...