Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 24

Displaying posts with tag: debugging (reset)

#DBHangOps 10/02/13 — MySQL Utilities, Resource Management, and more!
+0 Vote Up -0Vote Down

Thanks to everyone who came. Definitely check out the recording below!

Heyo everybody!

Coming up this Wednesday, October 2nd, 2013 at 12:00pm pacific (19:00 GMT) is another exciting #DBHangOps. Join the google hangout to discuss:

  • MySQL Utilities from Chuck Bell!
  • How do you constrain over-consumption of resources by competing applications?
  • Network vs. Local storage for MySQL
    • How do you use this for HA? Do you use DRBD or floating VIPs?
  • Secure connections to MySQL (using SSL) (requested by Daniel)
    • Do you have experience with this? What’s the performance impact?
  • PCI Certification with MySQL — what changed for you?
  • MySQL-isms!
    • (From Gerry) Sub SELECTs — Why aren’t these as

  [Read more...]
#DBHangOps 7/24/13 — Innobackupex, schema migrations, and more!
+1 Vote Up -0Vote Down

And all set. Check out the recording:

Hello everybody!

Coming up this Wednesday, July 23rd, 2013 at 12:00pm pacific (19:00 GMT) join in to hear:

  • Brandon Johnson from Mozilla talk about an issue he recently worked through with XtraBackup and the process he took to identify and resolve the issues.

And also take part in discussion around:

  • How do you apply production schema changes?
    • Do you use pt-online-schema-change?
      • Issues to watch out for
    • Just run the alter!
    • Pull from a pool and apply

Make sure to follow the #DBHangops twitter search, the DBHangops Twitter Feed, or this blog post to get a link for the google hangout on Wednesday!

Excited to see all of you joining in on the conversation!

The network is reliable
+2 Vote Up -0Vote Down

A fascinating post-mortem on high profile network failures:

This post is meant as a reference point–to illustrate that, according to a wide range of accounts, partitions occur in many real-world environments. Processes, servers, NICs, switches, local and wide area networks can all fail, and the resulting economic consequences are real. Network outages can suddenly arise in systems that are stable for months at a time, during routine upgrades, or as a result of emergency maintenance. The consequences of these outages range from increased latency and temporary unavailability to inconsistency, corruption, and data loss. Split-brain is not an academic concern: it happens to all kinds of systems–sometimes for days on end. Partitions deserve serious consideration.

#DBHangOps 3/27/13!
+0 Vote Up -0Vote Down

Hi everyone!

Here’s a video of this week’s #DBHangOps:

March 27th at 12:00pm PDT (19:00 GMT) is when the next #DBHangOps is gonna go down. Check out the twitter search and hop on the google hangout to contribute some discussion! This week’s topics are:


  [Read more...]
MySQL Debugging Methods Overview
+1 Vote Up -0Vote Down

Introduction
Debugging SQL code is a very important task these days. Unfortunately not all database servers support this feature. And MySQL is one of such servers. In spite of its wide feature set, debugging is not implemented in it. So the problem is that MySQL provides no API functionalities for code debugging. But the necessity to debug SQL code does not disappear and becomes more and more important each year. Some companies that develop tools to access data of MySQL server databases create their own debuggers that solve this problem to some extent.

Types of Debuggers
Now we will consider the types of debuggers that can be implemented for MySQL server and principles of their work.



  [Read more...]
MySQL Debugging Methods Overview
+0 Vote Up -0Vote Down
The article describes the ways to debug MySQL stored routines with a GUI tool.
Tale of a bug
+5 Vote Up -0Vote Down

This is a tale of the bug lp:798213. The bug report has the initial report, and a summary of the real problem obtained after detailed analysis, but it does not describe the processes of getting from the former to the latter. I thought it would be interesting to document this, as the analysis of this bug was rather tricky and contains several good lessons.

Background

The bug first manifested itself as a sporadic failure in one of our random query generator tests for replication. We run this test after all MariaDB pushes in our Buildbot setup. However, this failure had only occured twice in several months, so it is clearly a very rare failure.

The first task was to try to repeat the problem and get some more data in the form of binlog files and so on. Philip kindly

  [Read more...]
MySQL stored procedure debugging, can I sue for going insane?
+5 Vote Up -0Vote Down

Lets paint the picture:

Scenario part 1 : Migrating a couple thousand stored procedures from database technology X to mysql
Scenario part 2 : Legacy system where the people who wrote it left a long time ago
Scenario part 3 : Developers sure can get real creative and invent all kinds of ways to get data (eg: having a stored proc which formulates a big query using concat after going through a bunch of conditions (fair enough), BUT the parts making up the different queries are stored in a table on a database rather than within the stored proc itself) … talk about KIS – Keep it simple!!
Scenario part 4 : This stored proc references 18 tables, 4 views, and another two stored procedures on 5 databases

Now close your eyes and try to imagine that for a few seconds, nah kidding don’t want you to hurt




  [Read more...]
Debugging memory leaks in plugins with Valgrind
+2 Vote Up -0Vote Down

I had an interesting IRC discussion the other day with Monty Taylor about what turned out to be a limitation in Valgrind with respect to debugging memory leaks in dynamically loaded plugins.

Monty Taylor's original problem was with Drizzle, but as it turns out, it is common to all of the MySQL-derived code bases. When there is a memory leak from an allocation in a dynamically loaded plugin, Valgrind will detect the leak, but the part of the stack trace that is within the plugin shows up as an unhelpful three question marks "???":

==1287== 400 bytes in 4 blocks are definitely lost in loss record 5 of 8
==1287==    at 0x4C22FAB: malloc (vg_replace_malloc.c:207)
==1287==    by 0x126A2186: ???
==1287==    by 0x7C8E01: ha_initialize_handlerton(st_plugin_int*) (handler.cc:429)
==1287==    by 0x88ADD6:

  [Read more...]
Videos of Pythian Sessions from the 2010 O’Reilly MySQL Conference and Expo
+2 Vote Up -0Vote Down

Here’s a sneak peek at a video matrix — this is all the videos that include Pythian Group employees at the MySQL conference. I hope to have all the rest of the videos processed and uploaded within 24 hours, with a matrix similar to the one below (but of course with many more sessions).

TitlePresenterSlidesVideo link
(hr:min:sec)Details (Conf. site link)

Main Stage
Keynote: Under New Management: Next Steps for the CommunitySheeri K. Cabral (Pythian)N/A18:16
session 14808Ignite talk: MySQLtuner 2.0Sheeri K. Cabral (Pythian)PDF5:31N/A
Interview
Thoughts on Drizzle and

  [Read more...]
How to debug MySQL Connector Library in Visual Studio
+0 Vote Up -0Vote Down

In text:

1. Download “mysql-connector-net-6.2.2-src.zip”  from http://dev.mysql.com/downloads/connector/net/ and extract the zip file.  Note that we need ‘src’ version of library if we want to debug in visual studio.

2. Open your Visual Studio Solution and add  ”Mysql.data.csproj”  located at  “MySql.Data\Provider\” inside the extracted archive.

3. Add this project’s reference to your project (mysql.data).

4. Now you can debug into mysql.data methods.


Tagged: Connector/.NET, Debugging, MySQL, Visual Studio
MariaDB Buildbot configuration file published
+2 Vote Up -0Vote Down

I have now published the Buildbot configuration file that we use for our continuous integration tests in our Buildbot setup. Every push into main and development branches of MariaDB is built and tested on a range of platforms to catch and fix any problems early (and we also test MySQL releases before merging to easily see whether any new problems already existed in MySQL or were introduced by something specific to MariaDB).

The configuration is included in the Tools for MariaDB Launchpad project.

Now, the Buildbot configuration file is not something that most MariaDB users will

  [Read more...]
Fixing a MariaDB package bug
+4 Vote Up -0Vote Down

One of the things that I am really happy about in MariaDB is that we have our releases available as apt (and yum for Centos) repositories. This is largely thanks to being able to build this on the OurDelta package build infrastructure (which again builds on things like the Debian packaging scripts for MySQL).

Something like the Debian apt-get package system (which is also used by Ubuntu) is one of the major innovations in the Free Software world in my opinion. Debian has spent many years refining this system to where it is today. Want to run the mysql client, but it isn't installed? Just try to run it on your local Ubuntu host:

    $ mysql
    The program 'mysql' can be found in the following packages:
     * mysql-client-5.0
     * mysql-client-5.1
    Try: sudo apt-get install <selected package>
    -bash: mysql:

  [Read more...]
Debugging and ripple effects
+0 Vote Up -0Vote Down

Like I said earlier, every tiny change that the test suite reveals after code changes is significant. I caught a very subtle “bug” today in recent changes to mk-query-digest (a.k.a. mqd). If you like to read about subtle bugs, read on.

An mqd test on sample file slow023.txt began to differ after some pretty extensive code changes of late:

---
> # Query 1: 0 QPS, 0x concurrency, ID 0x2CFD93750B99C734 at byte 0 ________

The ID which depends on the query’s fingerprint has changed. It’s very important that we don’t suddenly change these on users because these IDs are pivotal in trend analyses with mqd’s --review-history option. First some background info on the recent code changes and then the little story




  [Read more...]
How GDB helped me fix a Drizzle Bug
Employee +1 Vote Up -0Vote Down

The other day I found a nice surprise on my inbox. Jay Pipes asked me if I'd like to try fixing a small bug on Drizzle. It looked pretty simple, and the bug report included a big part of the fix. I accepted without a doubt.
I decided to first change trans_prealloc_size from uint32_t to uint64_t. That was done on drizzled/session.h.Then, I went to

  [Read more...]
More on DTrace ... and MySQL
Employee +0 Vote Up -0Vote Down

Angelo recently showed an easy way to dump SQL queries using DTrace, while reading the articles I felt that some important information is missing: The name of the user executing the query and the selected database. So I sat down a few minutes and tried to collect that data.

For the database name I found a quite simple solution: It is passed as parameter to the check_user() function to MySQL so we can easily add a thread-local variable to keep that name. Simple script for that:

#!/usr/sbin/dtrace -s

#pragma D option quiet

pid$1::*check_user*:entry
{
self->db = arg4 ? copyinstr(arg4) : "(no schema)";
}

pid$1::*dispatch_command*:entry
{
printf("%s: %s\n", self->db,










  [Read more...]
The unexpected consequences of SELinux
+0 Vote Up -0Vote Down
I’ve been working with a client recently who has SELinux on his servers.  It has been quite a struggle sometimes. My colleages tell me that SELinux has a pretty noticeable performance impact.  I am not sure if we have benchmarks to support this; at any rate, the client said it’s OK, we’ll take the performance hit. There [...]
How to analyze memory leaks on Windows
+0 Vote Up -0Vote Down

We use valgrind to find memory leaks in MySQL on Linux. The tool is a convenient, and often enlightening way of finding out where the real and potential problems are location.

On Windows, you dont have valgrind, but Microsoft do provide a free native debugging tool, called the user-mode dump heap (UMDH) tool. This performs a similar function to valgrind to determine memory leaks.

Vladislav Vaintroub, who works on the Falcon team and is one of our resident Windows experts provides the following how-to for using UMDH:

  • Download and install debugging tools for Windows from here
    MS Debugging Tools
    Install 64 bit version if you’re on 64 bit Windows and 32 bit version
    otherwise.

  • Change the




  •   [Read more...]
    Writing to the MySQL error log
    +0 Vote Up -0Vote Down
    In almost all application development situations, one needs to log debug information now and then. In almost all production systems, one needs to log serious error events somewhere too.

    So, what can you do? Create a log table? Sprinkle your code with SELECT 'Debug: ...' statements?

    At the UDF Repository for MySQL, we now have a solution to log messages to the MySQL error log: a user-defined function called log_error().

    Currently it is all very crude: the log_error function takes one argument and writes it to the mysql_error





      [Read more...]
    Debugging MySQL Cluster data nodes(ndbd) using ndbout
    Employee +0 Vote Up -0Vote Down
    One basic way of debugging the MySQL Cluster data nodes(ndbd) is with good old printf-style debugging. Ie. adding printouts of the variable you want to see, recompile, start the node(s) and run your tests. This is a bit tedious but very universal.

    Support for printing is available using "ndbout", which has both C++ style and printf style. This functionality is implemented in storage/ndb/include/util/NdbOut.hpp

    Here is an example from debugging BUG#37592, where I wanted to add printouts to "Dbtup::rebuild_page_free_list" to see how the pageId increases while the rebuild is running:

    void
    Dbtup::rebuild_page_free_list(Signal* signal)
    {
    Ptr fragOpPtr;
    fragOpPtr.i = signal->theData[1];
    Uint32 pageId = signal->theData[2];
    Uint32 tail =











      [Read more...]
    Obtaining MySQL server execution traces
    Employee +0 Vote Up -0Vote Down

    Not sure if the post title actually reflects the contents. 

    This post describes how you can obtain the traces that MySQL server leaves behind for you if you ask it to. Once you have the traces, you can use it for:

    • Debugging - It can help you to find out which source file is the server crashing, for eg.
    • Learn- learn more about which functions/methods are called for a particular query by the client

    Okay, so lets start.

    Traceable Server

    To be able to obtain traces, your server needs to be compiled with "debug" enabled. If the version information shows you something like this:

     Ver 5.1.24-rc-debug for pc-linux-gnu on i686 (Source distribution)
    
    

    with 'debug' appended to the version name, then you have a


      [Read more...]
    Obtaining MySQL server execution traces
    Employee +0 Vote Up -0Vote Down

    Not sure if the post title actually reflects the contents. 

    This post describes how you can obtain the traces that MySQL server leaves behind for you if you ask it to. Once you have the traces, you can use it for:

    • Debugging - It can help you to find out which source file is the server crashing, for eg.
    • Learn- learn more about which functions/methods are called for a particular query by the client

    Okay, so lets start.

    Traceable Server

    To be able to obtain traces, your server needs to be compiled with "debug" enabled. If the version information shows you something like this:

     Ver 5.1.24-rc-debug for pc-linux-gnu on i686 (Source distribution)
    
    

    with 'debug' appended to the version name, then you have a


      [Read more...]
    MySQL stored procedurs: ...the CASE that they gave me...
    +0 Vote Up -0Vote Down
    Let's see if you can solve this little puzzle...

    Consider this stored procedure:

    -- finds the first slash and exits
    create procedure p_find_slash(p_text text)
    begin
    declare v_index int default 1;
    declare v_length int default character_length(p_text);
    declare v_char char(1);

    _main_loop: while v_index -- loop over all characters

    set v_char := substring(p_text, v_index, 1); -- grab the current character
    case v_char
    when v_char = '/' then -- found a slash!
    select concat('A slash at ', v_index) message; -- report it
    leave _main_loop; -- and then stop


















      [Read more...]
    PBXT & DBT2: Dubugging C/C++ 101
    +0 Vote Up -0Vote Down
    Yesterday I starting testing PBXT using the DBT2 benchmark. Following the implementation of durability and SELECT FOR UPDATE for the engine I was more interested in the benchmark as a test for stability and concurrency than performance. I was not disappointed...

    Which bug first?

    Well I immediately ran into 3 bugs. Isn't it funny how bugs often come in batches, which leaves you thinking: "Oh sh.. where do I start?". Here's my advice: start with the bug that is most likely to disappear if you fix the others!

    A simple example, you have 2 bugs: an unexpected exception is occurring, and you're loosing memory. First look for the memory loss, because it may disappear when you fix the exception (because you may be loosing memory in the error handler).

    Take things one problem at time:

    Another thing: once you have decided for one of the bugs,









      [Read more...]
    Showing entries 1 to 24

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.