MySQL test: it’s because of RQG that we now have a really solid MySQL Server

高性能MySQK(第三版) 本书是MySQL 凌宇的经典之作,拥有广泛的影响力,第三版更新了大量的内容,不但涵盖了最新的MySQL 5.5 版本的新特性,也讲述了关于固态盘,高可扩展性设计和云计算环境下的数据库相关的新内容! 立即下载

原文: https://www.flamingspork.com/blog/2014/03/17/ghosts-of-mysql-past-part-11-why-are-you-happy-about-this/

 

 
Ghosts of MySQL Past, part 11: Why are you happy about this?
Posted on by Stewart Smith

This is part 11 in what’s shaping up to be the best part of a 6 week series (Part 1, 2, 3, 4, 5, 6, 7, 7.1, 8, 8.1, 9 and 10) on various history bits of MySQL, somewhat following my LCA2014 talk (video here).

One of my favorite MySQL stories is the introduction of the Random Query Generator – or randgen. While I’ve talked for a while now about the quality problems that were plaguing MySQL, there were positive steps going on. The introduction of continuous regression testing with pushbuild, increasing test case coverage and a focus on bug fixing were all helping. However… a database server is a complex beast that can accept arbitrary queries and transactions and at the very least is expected not to segfault. How on earth do you test it beyond simple manual testing (or automated manual testing: running the same set of static queries)?

Well, at some point in development, David Axmark (one of the founders of MySQL AB) decided that if they were going to be a real database, they should have a test suite – so he wrote one. It was comprised of two parts: a small binary named mysqltest which basically read a file of SQL, ran it against the server and then displayed the results (and also had a couple of small bits of language such as variables and loops) and the other half was a shell script that started a mysqld and ran mysqltest for each .test file in the mysql-test/t/ directory and diffed the output against the mysql-test/r/*.result files.

This system still exists today, although the shell script has been replaced by a perl script which has been replaced with mysql-test-run.pl version 2 which dealt with replication, starting MySQL Cluster daemons, running tests in parallel and dealt with Windows a lot better. The mysqltest binary is largely unchanged however, and so the now MUCH larger suite of SQL based tests would be familiar a dozen years ago, when the mysql-test suite was in infancy.

But how do you ensure you’re testing enough of the server? Well… you can do code coverage analysis and write more tests manually, but wouldn’t it be much better if you could automatically generate tests? Wouldn’t it be great if you could automatically find a set of queries that caused the server to crash? Or a set of queries where the results differed between versions or other database servers (which would strongly indicate that somebody was buggy)?

Well, it turns out that Microsoft had a similar problem back in the 1990s with Microsoft SQL Server and a system called RAGS was used in the development of Microsoft SQL Server 7.0 (released in 1998).

So, fast forward about ten years and a relatively new hire of MySQL AB, Philip Stoev was working on something called “RQG” or Random Query Generator for MySQL AB. The basic idea was to be able to supply a grammar of what type of queries you would like it to generate, point it at a MySQL server and see what happens.

It turns out that what happened was that after a while, the MySQL server would segfault. To a room of MySQL Server developers, this was a pretty amazing advancement in testing the server – an automated way to find new bugs!

Throwing the Random Query Generator at the in-progress MySQL 6.0 optimizer caused a new innovation: automatic stack trace deduplication and test case minimization. RQG would automatically pair down the list of generated queries to the minimal set required to crash the server, so that you could import that set of queries into the existing mysqltest based regression test suite.

The dataset that RQG would work against was rather fixed, it was about 10 already prepared tables with some easily generated data. In MySQL Cluster, we had a set of C++ classes that ran a multithreaded application that would use integer columns as a checksum for the whole row, so updates would also update the checksum and at the end of your test (which may cause node failures in various scenarios) you can check that each row is intact and hasn’t been corrupted. So, IIRC it may have been me (or Jonas, I honestly cannot remember) who asked if such a feature would be added to RQG and the reply was “when I can no longer crash the server in 4 or 5 queries… I’ll think about it”.

So, developers expressed happiness, and Philip expressed this: “Why are you happy about this? We are about 10 years behind Microsoft in QA, why are you possibly happy about this?”

So with this great new tool, the true state of the current server version, the in-development server version (6.0) and all the optimizer enhancements it was bringing, the new Falcon storage engine and the in progress Maria (now Aria) storage engine would be exposed.

The news was not good.

(although, in the long run, the news was really good, and it’s because of RQG that we now have a really solid MySQL Server)

Further reading:


Massive Stochastic Testing of SQL, from VLDB98
A Genetic Approach for Random Testing of Database Systems

告别理论纠结!用ADS和Sigrity玩转电源完整性:从PDN阻抗优化到芯片供电仿真全流程 本文详细介绍了如何利用ADS和Sigrity工具进行电源完整性(PI)分析,从PDN阻抗优化到芯片供电仿真的全流程。通过频域、直流和时域分析,工程师可以精确评估电源网络性能,优化设计以避免电压波动和系统失效。文章还提供了ADS和Sigrity PowerDC的实战操作指南,帮助读者掌握现代PI设计的核心技术。 阅读详情

相关推荐

手把手教你用Cadence VPWLF源和参数扫描:搞定非周期激励与gmid曲线绘制(避坑指南)

本文详细介绍了如何在Cadence Virtuoso中使用VPWLF源生成复杂非周期激励信号,并结合gmid方法进行双参数扫描优化电路设计。通过实战案例和避坑指南,帮助工程师高效解决波形生成和参数可视化难题,提升模拟电路设计效率。

weixin_29260291的博客 431

mysql内核测试_RQG:MySQL内核开发人员的利器

【IT168 技术】MySQL Test Framework是每个MySQL内核开发人员必须熟悉的测试框架。然而,对于某些bug, MySQL Test脚本难以重现,而RQG(Random Query Generator)则是非常强悍的一个工具,可以很好的弥补此时MySQL Test的某些不足之处。RQG的原理就是基于用户自定的词法生成对应的语句并执行。剩下的,只要你来写.yy文件。1. 安装$ ...

weixin_42516710的博客 2498

气象数据收集

国家气象信息中心-中国气象数据网 (cma.cn)国家气象信息中心-中国气象数据网 (cma.cn)预报数据:需要定制,收费10万+路面数据同化系统,实时。

weixin_42209537的博客 3493

写数据库测试工具的一点心得

概述写一个好用,持续可用的测试工具,需要满足如下几个特征: 完备、封闭 自调度 结果可评价 易回归

余璜的技术博客 2778

Ubuntu双系统引导修复实战:boot-repair工具详解

本文详细介绍了使用boot-repair工具修复Ubuntu双系统引导丢失问题的实战方法。当GRUB引导菜单因安装新系统或更新而损坏时,通过制作Ubuntu启动盘进入Live环境,安装并运行boot-repair,可一键完成系统修复引导,自动化执行GRUB重装与配置,解决无法进入Windows或Ubuntu的常见故障。

weixin_29224589的博客 365

最新版Node.js下载安装及环境配置教程(非常详细)

选择对应你系统的Node.js版本。

DN金猿的博客 12万+

Get to know the Random Query Generator

导读本文介绍 MySQL 开发的随机SQL生成器 RQG,用于 MySQL 回归测试。作者充分肯定了 RQG 为 MySQL 5.6的稳定性做出的贡献。

余璜的技术博客 1742

halcon与QT联合:(5.1)瓶盖检测以及QT界面搭建

halcon实现瓶盖检测与定位代码: dev_close_window() dev_open_window(0, 0, 1024, 1024, 'black', WindowHandle) list_image_files('C:/Users/TIMI/Desktop/picture/circle', 'default', [], ImageFiles) for J := 1 to 4 by 1 *read image read_image(halconImage, ImageFil

m0_37957160的博客 1047

mysql5.6依赖_rqg: facebook mysql-5.6 需要用到的依赖包

Environment Setup=================Before using the test framework (referred to as MYR), the following items need to be setup.Environment Variables---------------------The following environment variabl...

weixin_32859127的博客 333

AutoSAR配置与实践(基础篇)2.5 RTE对数据一致性的管理

SWC内部不同的Runnable访问共同全局变量,Runnable类似C文件中的函数,这些函数如果被放在不同Task上运行, 可能出现出现同一时刻多个函数共同运行的情况。可以通过为受影响的任务分配相同的优先级,为受影响的任务分配相同的内部操作系统资源,或者将OS的任务配置为非抢占性来实现。数据一致性:当多个操作同时读写同一个数据,由于任务的抢占,出现了数据被篡改的情况,造成非预期的数据结果。SWC内部变量保护,限定局变量的作用域在变量的作用域在SWC的不同runnable间。

nihaoljq2010的博客 2632

Stable Diffusion 模型分享:Indigo Furry mix(人类与野兽的混合)

Indigo Furry mix 是一个混合模型,出的图具有雄性人类的体型和野兽的形态。条目内容类型大模型基础模型SD 1.5来源CIVITAI作者indigowing文件名称文件大小1.99GB。

水滴的博客 1848

MySQL QA 入门序列

下面是Percona团队的Roel Van de Paar写的一组连载,教新人如何做MySQL测试。值得一扫。

余璜的技术博客 1505

三态门Multisim电路仿真——硬件工程师笔记

三态门原理及应用摘要 三态门是具有高电平(1)、低电平(0)和高阻态(Z)三种输出的逻辑电路,通过使能端(EN)控制状态切换。高阻态时输出端等效断路,避免信号冲突。其核心应用包括: 总线系统:多设备共享总线时,仅使能选中设备的三态门,其余保持高阻态,防止干扰。 数据选择器:利用三态门切换多路输入信号,简化电路设计。 实现方式分两种: TTL三态门(三极管构成):低电平使能有效,仿真验证输出逻辑与高阻态。 MOS三态门(MOS管构成):高电平使能有效,仿真显示使能信号控制输出状态。 文中还附硬件工程师笔试面试

XU157303764的博客 2020

win10解决COM Surrogate问题

Fix Problems with COM Surrogate on Windows 10 For various PC problems, we recommend to use this tool. This tool will repair most computer errors, protect you from file loss, malwar

青墨 2万+

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

mysql内核开发最好的参考资料

mysql官方源代码说明手册https://dev.mysql.com/doc/dev/mysql-server/latest/ mysql源代码(下载源代码编译) 书籍:mysql核心内幕(对应的英文书籍:Understanding mysql internals) <要书籍的可以加我qq:1670171244> ...

青阳的博客 465

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

POJ-2492 A Bug's Life

A Bug's Life Time Limit: 10000MS   Memory Limit: 65536K       Description Background  Professor Hopper is researching the sexual behavior of a rare species of bugs. He a

JSure的代码库 1367

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

E - Largest Rectangle in a Histogram POJ - 2559 -单调栈第二弹

  E - Largest Rectangle in a Histogram  POJ - 2559  维护一个非严格的单调递增的单调栈,对于每个矩形,我们求出它向左向右分别能延伸的长度,然后乘以它的高度。 这就是以当前矩形为最低高度可以得到的最大的面积。只需要求个最大值即可。 总结性的来说就是:给定一序列,寻找某一子序列,使得子序列中的最小值乘以子序列的长度最大。 #i...

BePosit的博客 246

[Codeforces 161D] Distance in Tree

[题目链接] https://codeforces.com/contest/161/problem/D [算法] 点分治 记cnt[u][i]表示以u为根的子树中深度为i的点有多少个 时间复杂度 : O(NlogN) [代码] #include<bits/stdc++.h>...

170

appium v​​s ios模拟器ios真实设备设置,可成功实现移动自动化

Dear Bug Hunters! 亲爱的臭虫猎人! Mobile Automation is getting more popular everyday. Appium is one of the most popular tools for Mobile Automation. Configuring iOS simulator/real device to run your tests a...

weixin_26735419的博客 1220

Spring MVC视图解析器:配置多个视图解析器的优先级

问题 在Spring MVC应用程序中,我们经常需要应用一些视图解析器策略来解析视图名称。例如,联合使用三个视图解析器:InternalResourceViewResolver、ResourceBundleViewResolver和XmlViewResolver。 但是,如果返回了一个视图的名称,那么,使用哪一个视图解析器策略? 解决方法 如果应用了多个...

weixin_34121282的博客 370

多级菜单 简单实现

需求: 可依次选择进入下一层; 可从任意一层返回上一层; 可从任意一层退出程序。 摘于“老男孩儿网上课程作业” 多级菜单简单的思路就是多级循环,在while里面嵌套while循环,但是在写的过程中就会发现很多代码都是重复写,而且如果遇到100级的菜单就要写100级的循环,很不方便。 如何将代码尽量简化并且可以适用于N级菜单呢,其实可以用到list,将每一级菜单动态的存入到list中,要

SuperMan的博客 4971

求A^B的最后三位数表示的整数

Problem Description 求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方” Input 输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1<=A,B<=10000),如果A=0, B=0,则表示输入数据的结束,不做处理。 Output 对于每个测试实例,请输出A^B的最后三位表示的整数,每个输出占一行。 Sampl...

1298

HDU1829 A Bug's Life(并查集,深度记录)

A Bug's Life Time Limit: 15000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 19429Accepted Submission(s): 6206 Problem Description B...

weixin_33696106的博客 193

a href=#与 a href=javascript:void(0) 的区别

最近研究js,查看一些资料,发现a标签里面的href 属性 值为 "#" 和 javascript:void(0) 还是有很大区别的,故写点东西备忘 &lt;a href="#"&gt; 点击链接后,页面会向上滚到页首,# 默认锚点为 #TOP &lt;a href="javascript:void(0)" onClick="window.open()"&gt; 点击链接后,页面不

一个大龄码农的专栏 226
上一篇: 相关子查询与不相关子查询的优化(三)
下一篇: 分布式编程模式中的租约、事务和分布式事件机制
那海蓝蓝
那海蓝蓝 领域专家: 数据库技术领域 领域专家: 数据库技术领域 业界专家认证 业界专家认证
博客等级 码龄20年 568粉丝 425原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值