mysql内核 innodb存储引警(卷1)配书 用VS 2003 编绎 mysql-3.23.49 源代码

作者网址:http://www.innomysql.net/       

1.旧版 mysql-3.23.49-win-src.zip 下载 (科学上网络下载配书源代码)   或者  作者网盘  http://pan.baidu.com/s/1bnqK2dx  

  http://live.dadanini.at/mysql/downloads_html/mysql-3.23.html

  相关资料: 何登成 :http://vdisk.weibo.com/u/2216172320

 

 

2.打开工程 mysql.sln

error 1:

    正在创建临时文件“e:\mysql-3.23.49BAK\strings\debug\BAT000001.bat”,其内容为
[
@echo off
ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo ".\debug"\"strxmov".obj "e:\mysql-3.23.49BAK\strings\strxmov.asm"

if errorlevel 1 goto VCReportError
goto VCEnd
:VCReportError
echo Project : error PRJ0019: 工具从"正在执行自定义生成步骤"
exit 1
:VCEnd
]
正在创建命令行“"e:\mysql-3.23.49BAK\strings\debug\BAT000001.bat"”
正在创建临时文件“e:\mysql-3.23.49BAK\strings\debug\BAT000002.bat”,其内容为
[
@echo off
ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo ".\debug"\"strings".obj "e:\mysql-3.23.49BAK\strings\strings.asm"

if errorlevel 1 goto VCReportError
goto VCEnd
:VCReportError
echo Project : error PRJ0019: 工具从"正在执行自定义生成步骤"
exit 1
:VCEnd
]
正在创建命令行“"e:\mysql-3.23.49BAK\strings\debug\BAT000002.bat"

修改E:\mysql-3.23.49\strings 下的 strings.vcproj

<File
            RelativePath="Strxmov.asm">
            <FileConfiguration
                Name="Release|Win32">
                <Tool
                    Name="VCCustomBuildTool"
                    CommandLine="ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo .\debug\Strxmov.obj &quot;$(InputPath)&quot;
"
                    Outputs="$(OutDir)\$(InputName).obj"/>
            </FileConfiguration>
            <FileConfiguration
                Name="Debug|Win32">
                <Tool
                    Name="VCCustomBuildTool"
                    CommandLine="ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo .\debug\Strxmov.obj &quot;$(InputPath)&quot;
"
                    Outputs="$(OutDir)\$(InputName).obj"/>
            </FileConfiguration>
        </File>

 

<File
            RelativePath="Strings.asm">
            <FileConfiguration
                Name="Release|Win32">
                <Tool
                    Name="VCCustomBuildTool"
                    CommandLine="ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo .\debug\strings.obj &quot;$(InputPath)&quot;
"
                    Outputs="$(OutDir)\$(InputName).obj"/>
            </FileConfiguration>
            <FileConfiguration
                Name="Debug|Win32">
                <Tool
                    Name="VCCustomBuildTool"
                    CommandLine="ml /Cx /nologo /DDOS386 /DM_I386 /Zm /coff /c /Fo .\debug\strings.obj &quot;$(InputPath)&quot;
"
                    Outputs="$(OutDir)\$(InputName).obj"/>
            </FileConfiguration>
        </File>

error 2:

正在编译...
cxx_txn.cpp
../bdb\build_win32\db_config.h(218) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory
cxx_table.cpp
../bdb\build_win32\db_config.h(218) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory
cxx_mpool.cpp
../bdb\build_win32\db_config.h(218) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory
cxx_log.cpp
../bdb\build_win32\db_config.h(218) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory
cxx_lock.cpp
../bdb\build_win32\db_config.h(218) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory
cxx_except.cpp
../bdb\build_win32\db_config.h(218) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory
cxx_app.cpp
../bdb\build_win32\db_config.h(218) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory

在 E:\mysql-3.23.49\bdb\build_win32\下找到db_config.h
修改db_config.h 第218行   修改为

#include <iostream>
using namespace std;

error 3

cxx_txn.cpp
../bdb\include\db_cxx.h(52) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory
cxx_table.cpp
../bdb\include\db_cxx.h(52) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory
cxx_mpool.cpp
../bdb\include\db_cxx.h(52) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory cxx_log.cpp ../bdb\include\db_cxx.h(52) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory cxx_lock.cpp ../bdb\include\db_cxx.h(52) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory cxx_except.cpp ../bdb\include\db_cxx.h(52) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory cxx_app.cpp ../bdb\include\db_cxx.h(52) : fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory

在E:\mysql-3.23.49\bdb\include下找到 db_cxx.h, 定位到52行修改为

#include <iostream>
using namespace std;


error 4

LINK : fatal error LNK1181: 无法打开输入文件“mysqlclient.lib”

生成日志保存在“file://e:\mysql-3.23.49\client\mysqlcheck___Win32_Release\BuildLog.htm”中 mysqlcheck - 1 错误,0 警告

方法 .在选择  mysqlcheck 项目,右击选择 属性  -》常规-》附加库目录  加入  ..\lib_debug\目录 

 

error 5 库冲突与函数引用

解决方法:

 

3.调试MYSQL

1.mysqld  --debug --standalone --console(CMD 窗口不能关,否则就非正常退去了)

2.打开VS 2003 ,打开mysql.sln

3.在VS 2003中设定想要设定的断点

4.工具->调试->附加到进程->选择 mysqld       (本地native)

5.mysql -u root 在这个窗口中 执行SQL命令,VS 2003会在源码中中断到相关细节,进而进行动态调试

6.mysqladmin shutdown -u root //调试完毕后关闭mysqld

 

mysql 跟踪文件:e:\mysqld.trace 

c:\my.cnf

[mysqld]

basedir=E:\mysql-3.23.49
datadir=E:\mysql-3.23.49\data
innodb_data_home_dir=E:\mysql-3.23.49\data
innodb_data_file_path=ibdata1:30M

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值