Scenarios:-
I met with requirements where database has to generate business
error if users are try to fetch more than 1000 records
from table.
Solutions:-
In MySQL to handle business error , we have to implement
SIGNAL/RESIGNAL in code business logic.
This enable us to any time we can break our execution of code
flow & generate Business Error as per our
Requirements.
There is no privileges are required to execute SIGNAL/RESIGNAL
statement.
To handle normal error block, we have DECLARE CONTINUE/EXIT
HANDLER ... Block , what it does is when ever encountered error
during code execution HANDLER Block triggered and manage code
execution inside of it. it is more flexiable because developers
gets flexibility to write multi-statements inside HANDLER
blocks.
More
Info: https://dev.mysql.com/doc/refman/8.0/en/resignal.html
…
The old adage that time is money does not give any hints about buying more time. A MySQL Enterprise subscription does allow you to purchase time. Your technical staff has to do more with less time than ever before and operational delays add up extremely quickly. Having the right tools when things go critical means staff can do what they need to do, when they need to do it.
So how does MySQL Enterprise Edition buy you more time?
When things inevitably go wrong, searching for free answers to problems on web sites with many dubious or flat out wrong solutions is a waste of precious time. Informational websites like are fine sources of general information for researching technical issues but not when mission critical services are degraded or down. An online recommendation to do what very large Enterprise Company does may not make sense for your company if you are not …
[Read more]
JSON has proven to be a very import data format with immense
popularity. A good part of my time for the last two or so years
has been dedicated to this area and I even wrote a book on the subject. This is a
comparison of the implementations of handling JSON data in MySQL
and MariaDB. I had requests from the community and customers for
this evaluation.
JSON Data Types Are Not All Equal
MySQL added a JSON data type in version 5.7 and it has proven to
be very popular. MariaDB has JSON
support version 10.0.16 but is actually an alias to a
longtext data type so that statement based replication
from MySQL to MariaDB is possible.
MySQL stores JSON documents are …
MySQL Replication Data Recovery using 'mysqlbinlog' - Part
II
The previous post (PART-I)
http://mysqlhk.blogspot.com/2018/10/mysql-replication-recovery-from-binlog.html
It describes the Replication Recovery from binlog by using those
binlog files to be treated as Relay Log. The Relay Log
mechanism when the server is startup, the recovery is the
SQL_THREAD applier to apply data to the
database. Check on the PART-I post for
details.
Part II is about using the MySQL utility "mysqlbinlog" to dump
the content from binlog files and apply the SQL to the
Database.
Documentation
https://dev.mysql.com/doc/refman/8.0/en/mysqlbinlog.html
https://dev.mysql.com/doc/refman/8.0/en/point-in-time-recovery.html
The following sections describe the tutorial for Replication Data
Recovery using 'mysqlbinlog'.
The tutorial …
MySQL 8.0 Code Contributions (Shutterstock)
An Oracle engineer thanked two Percona engineers by name, along with engineers from Facebook and elsewhere, for their recent MySQL 8.0 source code contributions. Oracle incorporated their work into its latest MySQL production release (8.0.13).
Percona’s Zsolt Parragi authored a patch for a rare replication bug that left locked mutexes in production builds following debug crashes (bug # …
[Read more]Somebody on Freenode wanted this:
Source Result +----+------+ +----+------+ | id | x | | id | c | +----+------+ +----+------+ | 1 | 1 | | 1 | 2 | | 2 | 1 | | 2 | 2 | | 3 | NULL | | 3 | NULL | | 4 | NULL | -> | 4 | NULL | | 5 | 1 | | 5 | 1 | | 6 | NULL | | 6 | NULL | | 7 | 1 | | 7 | 3 | | 9 | 1 | | 9 | 3 | | 10 | 1 | | 10 | 3 | +----+------+ +----+------+
The result uses the NULL values in x as boundaries of windows, and counts the number of rows within each window. I don’t know why anyone wants such a thing; it is not ours to reason why…
Anyway, the point is that you can use arbitrary expressions, even subqueries, to define your window partitions.
SELECT id, -- Count of rows in windows bound by NULL values in x IF( x IS NULL, NULL, COUNT(*) OVER (PARTITION BY ( -- …[Read more]
If you’re here, that probably means you’re about to acquire some sensitive data to take care of. Or that you’ve already acquired it and are protecting it, and you want to see how MySQL Enterprise Data Masking and De-Identification features can help you do it in an easier, better and more efficient manner.…
As promised, here are slides about MySQL 8.0 Performance
from my talks at Oracle Open World 2018 and Percona LIVE Europe
2018 -- all is combined into a single PDF file to give you an
overall summary about what we already completed, where we're
going in the next updates within our "continuous release", and
what kind of performance issues we're digging right now..
;-))
Also, I'd like to say that both Conferences were simply awesome,
and it's great to see a constantly growing level of skills of all
MySQL Users attending these Conferences ! -- hope you'll have
even more fun with MySQL 8.0 now ;-))
Welcome to Wednesday at Percona Live Europe 2018! Today is the final day! Check out all of the excellent sessions to attend.
Please see the important updates below.
Download the conference App
If you haven’t already downloaded the app, go to the app store and download the official Percona Live App! You can view the schedule, be alerted for any important updates, create your own personalized schedule, rate the talks and interact with fellow attendees.
For Apple: Download here
For Android: …
Common Table Expressions (CTEs) are a very useful tool and
frankly a big improvement on sub-queries. But there are
differences in how they are implemented in MySQL and
MariaDB. That is not too surprising since the code
fork many years ago. Different engineers implementing the same
idea will have different approaches (and sometimes results). But
differences in implementation are often important and, in this
case, shockingly different.
Jesper Wisborg Krogh at Oracle OpenWorld and CodeOne gave a
series of presentations and hands on labs that were excellent. He
is an amazing Support Engineer and a great presenter of material
at conferences. In the lab for Common Table Expressions he
did point out to me an interesting problem in MariaDB's
implementation of CTEs.
The Problem In a Nutshell
On the PostgreSQL Wiki, there is a
an SQL query (requires PostgreSQL 8.4 or MySQL 8.0) that …