June 19, 2013

Post: Can MySQL temporary tables be made safe for statement-based replication?

… transaction is inside a stored procedure? Whether this works or not depends, again, on how the stored procedure call is logged to the binary log. Let’s create a stored procedure to hold the transaction… into a non-temporary InnoDB table: master > delimiter // master > create procedure test_temp() begin -> start transaction; -> create temporary table test.t…

Post: 10+ Ways to Crash or Overload MySQL

… their queries. Stored Procedures – How much memory can stored procedure allocate ? say can you create 1000 variables in stored procedure and set 1M… stored procedure language constructions but I do not think tight memory allocation policy is enforced. Stored Procedures Cursors – Cursors inside of stored procedures

Post: Ultimate MySQL variable and status reference list

…_pluginsblogpercona.commanual Com_show_privilegesblogpercona.commanual Com_show_procedure_codeblogpercona.commanual Com_show_procedure_statusblogpercona.commanual Com_show_processlistblogpercona.commanual Com_show…

Post: SQL Injection Questions Followup

…: Q: If you’re writing Dynamic SQL in your Stored Procedures you have other issues :)   I consulted for a customer who… dynamic SQL in stored procedures extensively.  They found that it was awkward because of the limits of the procedure language MySQL offers… edge cases where it’s appropriate to use a stored procedure, even one that writes dynamic SQL.  And it only takes…

Comment: MySQL Prepared Statements

…_PROCEDURE_NAME(?, ?, ?, ?, ?) }”); when using jdbc java connectorJ They are (see in logs): Query SELECT DATABASE() Query SHOW CREATE PROCEDURE `db_name`.`SOME_PROCEDURE_NAME` Query SELECT name, type, comment FROM mysql.proc WHERE name like ‘SOME_PROCEDURE_NAME’ and…

Post: Flexviews - part 3 - improving query performance using materialized views

… a MySQL stored procedure API, called the SQL_API which is used to define the view. These stored procedures maintain the Flexviews… and maintain the view. You should always use the stored procedures to modify the dictionary. Do not modify it directly. convert…, is the value proposition for Flexviews. The flexviews.refresh() stored procedure The first parameter to flexviews.refresh() is the materialized view…

Comment: Mass killing of MySQL Connections

….PROCESSLIST one can create a stored procedure using server cursor to achieve this. The following procedure accepts a user name and kills… solution for ‘eval’. Shlomi DELIMITER $$ DROP PROCEDURE IF EXISTS `test`.`kill_user_queries`$$ CREATE PROCEDURE `test`.`kill_user_queries` (kill_user_name…

Comment: InnoDB vs MyISAM vs Falcon benchmarks - part 1

… desirable in many cases, you should also consider calling stored procedures if you are worried about some kind of client-failure… to the client Here you can easily make a stored procedure that handles everything, from checking, inserting, updating etc. The PHP… would then simply look like – Check validity – Call the stored procedure with the required parameters – Send feedback to the client So…

Comment: Slow Query Log analyzes tools

… trace every SQL statement executed inside a procedure that is called by a client: CREATE PROCEDURE foo() NOT DETERMINISTIC MODIFIES SQL DATA… the call to the procedure; it does not provide any trace of every subsequent statement executed by the procedure itself: # Time: 070607…

Post: Profiling MySQL Memory Usage With Valgrind Massif

… not sure if you have stripped binaries, simply test the procedure below and see what output you get. Once you’re… debug symbols, shutdown your mysqld server using your standard shutdown procedure, and then re-start it manually under Valgrind using the…’ve done that, shutdown mysqld (again using your normal shutdown procedure), and then use the ms_print tool on the masif…