Showing entries 11 to 20 of 61
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: Technical (reset)
Improve your Stored Procedure Error Handling with GET DIAGNOSTICS

In a previous post, I discussed debugging stored procedures with RESIGNAL, which is of great value when troubleshooting errors raised by your stored procedures, functions, triggers, and events as of MySQL/MariaDB 5.5.

However, as of MySQL 5.6 and MariaDB 10.0, there is GET DIAGNOSTICS, which can be used to get the exact error details as well.

RESIGNAL just outputs the error, as it comes from the server, for instance:

ERROR 1146 (42S02): Table 'db1.t1' doesn't exist

read more

Quickly Debugging Stored Procedures, Functions, Triggers, and Events with RESIGNAL

I was recently debugging a stored procedure and could not easily identify the underlying reason for why it was failing.

It had a standard exit handler catch-all for SQLEXCEPTION, which was:

DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
SELECT ...;
END;

When there was an error, it didn't really output anything useful.

As of MySQL 5.5, there is RESIGNAL:

"RESIGNAL passes on the error condition information that is available during execution of a condition handler within a compound statement inside a stored procedure or function, trigger, or event."

read more

MariaDB 10 GTID Explained

MariaDB replication in general works as follows: on a master server, all updates to the database are written into the binary log as binlog events, a slave server connects to the master and reads the binlog events and applies the events locally to replicate the same changes as done on the master. A server can be both a master and a slave at the same time, it is thus possible for binlog events to replicated through multiple levels of servers.

read more

InnoDB Primary Key versus Secondary Index: An Interesting Lesson from EXPLAIN

I ran into an interesting issue today, while examining some EXPLAIN outputs, and wanted to share the findings, as some of this is undocumented.

Basically, you can start with a very simple InnoDB table - 2 INT columns, Primary Key (PK) on the 1st column, regular index on the 2nd:

CREATE TABLE `t1` (
  `id1` int(10) unsigned NOT NULL,
  `id2` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id1`),
  KEY `id2` (`id2`)
) ENGINE=InnoDB;

The query is:

SELECT id1 FROM t1;

This is a straight-forward query with no WHERE clause.

read more

MySQL to MariaDB migration: handling privilege table differences when using mysqldump

Migrating from MySQL to MariaDB is generally a straightforward procedure: you can shut down MySQL, install MariaDB, and start it up with a very good chance of success. When upgrading/crossgrading/migrating from one release of MySQL or MariaDB to another, it is important to run mysql_upgrade. The same is true when migrating from MySQL to MariaDB, in part because MariaDB has some different definitions for certain privilege tables. This means that the structures of the MySQL tables are not valid for MariaDB, a problem easily fixed by mysql_upgrade, unless you are trying to import an SQL dump from MySQL that creates tables using the old-style structures and tries to interact with them before it is possible to run mysql_upgrade. Let's take a look at why this is a problem and how to solve it.

[Read more]
MariaDB 10.0.8 Overview and Highlights

MariaDB 10.0.8 was recently released as RC ("Release Candidate"), and is available for download here:

https://downloads.mariadb.org/mariadb/10.0.8/

This is the first RC release of MariaDB 10.0. It is primarily a bug-fix and polishing release, and all features planned for MariaDB 10.0 GA are included in this release.

There were 6 notable changes in MariaDB 10.0.8:

  1. InnoDB upgraded to version 5.6.14

read more

MaxScale for the rest of us - Part 2

The first blogpost in this series did a quick introduction to MaxScale, but now it is time start getting our hands dirty. We will get a more practical view on MaxScale and begin to put it to work. The following is based on a simple Proof of Concept that I did recently. The application is a mid-size web-based online shop where scalability is becoming an issue. They use PHP and with an old and rather inflexible framework, so even though changing how the database is used is possible, it's not easy and having database routing in the application code isn't a very good idea either.

read more

MaxScale - We'd Love to Know Your Thoughts

As you've heard, MaxScale was recently released, and we'd love for you to try it out and let us know your thoughts.

Anders Karlsson and Ivan Zoratti have written some excellent posts on downloading and setting it up, so if you're intersted in that, please see their respective posts for quick, detailed instructions.

read more

MaxScale - Do we need another MySQL proxy?

I have spent some time thinking about and working on a project that went public on GitHub at the beginning of this year. That project is called MaxScale and is primarily a proxy server for MySQL/MariaDB databases, although it can be something much more than this. The obvious and often asked question is why do we need another proxy? I want to try to give you a flavor for what MaxScale is and why I think there is a need for a tool like MaxScale.

The architecture of MaxScale makes it different from your average proxy

  • MaxScale has awareness of the content it is shipping.

read more

Activating Auditing for MariaDB and MySQL in 5 Minutes

Do you want to learn more about the MariaDB Audit-Plugin? Join Ralf Gebhardt on 5.12.2013 for his live webcast: http://www.skysql.com/why-skysql/webinars/mariadb-audit-plugin-overview

Introduction

read more

Showing entries 11 to 20 of 61
« 10 Newer Entries | 10 Older Entries »