Visual Studio Code (VS) supports memory dump debugging via C/C++ extension: https://code.visualstudio.com/docs/cpp/cpp-debug#_memory-dump-debugging. When MySQL generates a core file, the VS code simplifies the process of debugging. This blog will discuss how to debug the core file in VS code.Installing c/c++ extensionWe need to install the c/c++ extension. Here are the instructions for doing so. In […]
In this blog, I will share the steps I took to debug an error ‘ERROR 1030 (HY000): Got error 168 – ‘Unknown (generic) error from engine’ from storage engine’ while…
The post How to fix 1030 Unknown generic error from engine in MySQL first appeared on Change Is Inevitable.
At the Percona engineering team, we often receive requests to analyze changes in MySQL/Percona Server for MySQL behavior from one version to another, either due to regression or a bug fix (when having to point out to a customer that commit X has fixed their issue and upgrading to a version including that fix will solve their problem).
In this blog post, we will analyze the approach used to fix PS-7019 – Correct query results for LEFT JOIN with GROUP BY.
Each release comes with a lot of changes. For example, the difference between MySQL 8.0.19 to 8.0.20:
git diff mysql-8.0.19..mysql-8.0.20 | wc -l 737454 git diff mysql-8.0.19..mysql-8.0.20 --name-only | wc -l 4495
737K lines in 4495 files have changed from one minor version to another.
git …[Read more]
Lately, I worked on several queries which started returning wrong results after upgrading MySQL Server to version 5.7 The reason for the failure was derived merge optimization which is one of the default
optimizer_switch
options. Issues were solved, though at the price of performance, when we turned it
OFF
. But, more importantly, we could not predict if any other query would start returning incorrect data, to allow us to fix the application before it was too late. Therefore I tried to find reasons why
derived_merge
can fail. Analyzing the problem
In the first run, we turned SQL Mode
ONLY_FULL_GROUP_BY
on, and this removed most of the problematic queries. That said, few of the queries that were successfully working with
ONLY_FULL_GROUP_BY
were affected.
A quick search in the …
[Read more]
We have been told many times that modifying live database should
be done with extreme care, we should always make a backup before
doing something big to the database. However, there are countless
stories on the Internet about losing data due to various reason,
one of them is forgetting to create a backup (Gitlab is an
example: https://about.gitlab.com/2017/02/01/gitlab-dot-com-database-incident/).
I was facing the same issue when upgrading MySQL server to a new
version. Luckily I was able to restore most of the data but it
was still a very good lesson for me. One of lesson I learned is
how we could restore the data from the *.ibd
and
*.frm
file.
The database I worked with had many tables. There were about 5 of them using MyISAM engine while others were using InnoDB engine. I was asked to upgrade …
[Read more]Welcome to another post in our series of interview blogs for the upcoming Percona Live Europe 2017 in Dublin. This series highlights a number of talks that will be at the conference and gives a short preview of what attendees can expect to learn from the presenter.
This blog post is with Charity Majors, CEO/Cofounder of Honeycomb. Her talk is Debugging with Logs (and Other Events). Her presentation covers some of the lessons every engineer should know (and often learns the hard way): why good logging solutions are so expensive, why treating your logs as strings can be costly and dangerous, how logs can impact code …
[Read more]
Sometimes MySQL surprises you in ways you would have never
imagined.
Would you think that the order in which the indexes appear in a
table matters?
It does. Mind you, not the order of the columns - the order of
the indexes.
MySQL optimizer can, in specific circumstances, take different
paths, sometimes with nefarious effects.
Please consider the following table:
CREATE TABLE `mypartitionedtable ` (
`HASH_ID` char(64) NOT NULL,
`RAW_DATA` mediumblob NOT NULL,
`EXPIRE_DATE` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP,
KEY `EXPIRE_DATE_IX` (`EXPIRE_DATE`),
KEY `HASH_ID_IX` (`HASH_ID`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ROW_FORMAT=TOKUDB_UNCOMPRESSED
/*!50100 PARTITION BY RANGE (UNIX_TIMESTAMP(EXPIRE_DATE))
(PARTITION p2005 VALUES LESS THAN (1487847600) ENGINE = …
DNS is one of the most fundamental parts of a website. No website can run without a proper configuration on DNS. For beginners, it might be a bit difficult for them to understand and resolve DNS-related issues. This post aims to provide a bit more help for those who are still struggling to configure the DNS for their websites.
In short, what is DNS and why we need it?
DNS stands for Domain Name Service. You can think of it as a
computer responsible for converting the domain name to an IP
address. For example, if I type facebook.com
into my
browser, the DNS will look into its database and return the IP
address of this domain, which is 66.220.158.68
.
Because of this, most of the issues about the domain name of your
websites are related to DNS.
We need DNS because our human memory is limited and we cannot remember all complex and meaningless IP addresses of all websites in the world. It is just like …
[Read more]Welcome to MySQL QA Episode 3: “Debugging: GDB, Backtraces, Frames and Library Dependencies”
In this episode you’ll learn how to use debugging tool GDB. The following debugging topics are covered:
1. GDB Introduction
2. Backtrace, Stack trace
3. Frames
4. Commands & Logging
5. Variables
6. Library dependencies
7. c++filt
8. Handy references
– GDB Cheat sheet (page #2): https://goo.gl/rrmB9i
– From Crash to testcase: https://goo.gl/3aSvVW
Also expands on live debugging & more. In HD quality (set your player to 720p!)
The post MySQL QA Episode 3: How to use the debugging tool GDB appeared …
[Read more]Recently I had a need to determine the session value of a MySQL plugin variable in a core file. Here I use the word plugin variable to refer to MySQL system variables provided by plugins. While this is not a very difficult task, it is not as straight forward as printing a global variable. It took some time to figure out the layout of the plugin variables and get the needed information. This short article is to share this gdb tip with other interested MySQL developers and support engineers.
In this article, let us inspect the session value of the plugin variable innodb_strict_mode, which is of type boolean. Quite obviously, this plugin variable is provided by InnoDB storage engine.
The Quick Answer
…
[Read more]