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 中文
Previous 30 Newer Entries Showing entries 31 to 60 of 65 Next 5 Older Entries

Displaying posts with tag: stored procedure (reset)

MySQL Stored procedure – Execute query if table or Column exists
+0 Vote Up -0Vote Down
Well procedures mainly carried out working with information schema and it’s usage in stored procedure. Procedures are fairly simple and easy to understand. 1. Edit_table – following procedure executes queries to particular table if it exists. Basically I created it to satisfy a need of altering a table if column exists. Now it can be used […]
Stored procedure to Find database objects
+0 Vote Up -0Vote Down
This procedure lists available database objects under passed database name. It lists present Tables, Views, Stored Procedures, Functions and Triggers under particular database. It also lists storage engine of tables. It uses information schema database to gather information and storing in a temporary table. [ad#ad-2-300x250] Usage: call xplore(database-name); - Procedure will search through information schema […]
Calculate Mysql Memory Usage – Quick Stored Proc
+0 Vote Up -0Vote Down
While going through mysql doc and MySQL Server Memory Usage, I noted following quick points regarding how mysql uses memory. We have global buffers which are allocated irrespective of connections as and when mysql server is started. Along with that mysql server allocates memory to each thread to perform respective tasks. So the formula goes: Mysql […]
Search / find through all databases, tables, columns in MySQL
+0 Vote Up -0Vote Down
What will you do if one day some one ask you to find single string in all databases, all tables and in all columns? I just read such question and tried to find a “ready made” solution. Reusability is Key Concept !! But I ended up finding no “copy-paste” material. Some of the posts like http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm helped me […]
A year in review; new direction.
+0 Vote Up -0Vote Down
It has been more than a year since my self-imposed hiatus from serious MySQL development started and I think it is about time that I get back into the saddle. I have a handful of working prototypes but I should get the code out there, back into the community.I learned a bunch of stuff during the past year at Google but in the end, working on JavaScript, HTML/CSS and Google proprietary languages
MySQL processlist – (show/kill processes)
+1 Vote Up -0Vote Down

It”s not the most common task in the world, but you might want to view processes from a particular user and once in a while you might even need to kill processes from a single user, be it during an attack or because you simply got a bug in an application bombarding your db server with connections!

Here is a small stored procedure which does exactly that!

call process_list("show","username","hostname");

– shows all processes owned by username@hostname

call process_list("kill","username","hostname");

– kills all processes owned by username@hostname

The code for this stored procedure can be found below. If you have any comments / suggestions feel free to comment below.

  [Read more...]
Perl and Java Stored Procedures for MariaDB 5.1
+1 Vote Up -0Vote Down
I just applied the external stored procedure patch to a branch of MariaDB and uploaded it to LaunchPad.You can see the branch at https://code.launchpad.net/~atcurtis/maria/5.1-wl820Note that this is not in any reasonable condition to merge into MariaDB. Hopefully we can engage in dialog as to how we can bring this feature properly to MariaDB, MySQL and Drizzle, hopefully making the plugins
Downloads for External/Perl Stored Procedures (aka LaunchPad is painfully slow)
+1 Vote Up -0Vote Down
It appears that LaunchPad.net is pretty slow.So that people can have something to play with, I have transferred files to my own web site.Presentation files:UC2009_presentation.zipSource downloads:mysql-5.1.34.tar.gzmysql-5.1.33.tar.gzPlease don't melt my router.... kthanx.
Perl Stored Procedures for MySQL
+0 Vote Up -0Vote Down
Files used in conference presentation here: UC2009 presentationI think todays presentation for Perl Stored Procedures for MySQL was quite successful. The audience was quite engaged and asked questions throughout (yes, I invited questions through the talk). I made sure to mention Eric Herman's Java plugin because even though he didn't get time to submit a talk, the work is noteworthy. Sometimes I
External Stored Procedures for MySQL
+0 Vote Up -0Vote Down
Finished my presentation earlier this afternoon. I had a better audience than last year and there was interest in the download URL for the source tarballs so I hope to see people hacking on it soon.The link to the presentation is here.There has been lots of good communication with staff from MySQL^WSun Microsystems^W^WOracle so maybe we shall see this code to begin to be integrated soon. In other
MySQL 5.1.32 + External Stored Procedures
+0 Vote Up -0Vote Down
I have synced the codebase with the 5.1.32 release of MySQL and it appears to work just fine. Sometimes frustrating that Bazaar takes a bizarre amount of time to do a merge.Download link for the source tarball are available from LaunchPad Download.As an experiment, I have built a Mac OS 10.5 installer package (x86 32bit) which I have also placed there. Took a bit of fiddling about to discover how
Making SVG graphs with MySQL Perl Stored Procedures
+0 Vote Up -0Vote Down
It is possible to generate SVG graphs directly without requiring access to the Google Chart Servers. Perl provides a wealth of libraries which can create SVG graphs (but most not quite as pretty as the charts which the Google service creates).This could be invaluable for people who want to serve all the information from their own website - for example, SSL encrypted websites - where some 'secured
Yet more on Stored Procedure performance
+0 Vote Up -0Vote Down
In Karlsson's blog post, More on Stored Procedure performance, he has written a simple C program to send queries repeatedly to the MySQL server in order to do performance measurement. Unfortunately, his sample client will end up factoring a lot of the synchronous communications overhead in to his performance comparison.

I think that he should enable the MySQL multi-statement feature and then perform his comparison by concatenating the test statement repeatedly before sending it to the server:

#include <my_global.h>
#include <mysql.h>
#include <my_sys.h>
#define MY_SOCKET "/tmp/mysql.sock"

int main(int argc, char *argv[])
int i, nLoop;
char *pStmt;

  [Read more...]
+0 Vote Up -0Vote Down

When using Oracle, the data dictionary provides us with tons of tables and views, allowing us to fetch information about pretty much anything within the database. We do have information like that in MySQL 5.0 (and up) in the information_schema database, but it’s scattered through several different tables.

Sometimes a client asks us to change the datatype of a column, but forgets to mention the schema name, and sometimes even the table name. As you can imagine, having this kind of information is vital to locate the object and perform the requested action. This kind of behaviour must be related to Murphy’s Law.

In any case, I’d like to share with you a simple stored procedure that has helped us a lot in the past.

USE dba;
  [Read more...]
Re: Are MySQL stored procedures slow?
+0 Vote Up -0Vote Down
In Brooks Johnson's blog posting, Database Science: Are MySQL stored procedures slow?, he mentioned how much slower MySQL's stored procedures are and then compared it with a small piece of .Net code.

Using Perl, a stored procedure which counts to the same value is obviously not going to be as fast as bytecode languages with JIT compilers but it is a lot faster than MySQL's native SQL stored procedures. These perl stored procedures are able to perform dynamic SQL using the familiar DBD::mysql driver without any risk of self-deadlock.

Of course, you can also write stored procedures in Java for many databases but I haven't yet written the neccessary Type 2 JDBC driver to perform a in-thread connection back into the database server to be

  [Read more...]
Table functions in MySQL
+0 Vote Up -0Vote Down
Less than 48 hours after starting to scratch this itch, I have table functions working in my WL820 repository on Launchpad.It is pretty nifty:mysql> INSTALL PLUGIN Deep_Thought SONAME 'psm_example.so';Query OK, 0 rows affected (0.10 sec)mysql> CREATE FUNCTION test.FooAnswer() -> RETURNS TABLE(answer TEXT) -> NO SQL LANGUAGE Deep_Thought EXTERNAL NAME 'compute';Query OK, 0 rows affected (
New in MySQL 5.1: Sheeri’s Presentation
+0 Vote Up -0Vote Down

In a nutshell: What’s New in MySQL 5.1.

Release notes: Changes in release 5.1.x (Production).

And yes, very early on (at about two minutes in), I talk about my take on Monty’s controversial post at Oops, we did it again.

To play the video directly, go to http://technocation.org/node/663/play. To download the 146 Mb video to your computer for offline playback, go to http://technocation.org/node/663/download. The slides can be downloaded as a

  [Read more...]
Updated External Language Stored Procedures
+0 Vote Up -0Vote Down
I have merged the code from the mysql-5.1 launchpad repository which should put this repository up to the recent 5.1.28-rc version. You can examine the source repository here.On a related note, had a brief email exchange with Eric Herman and so I hope that there will be time for him to do some work to complete the support for Java stored routines.
I am now at Google!
+0 Vote Up -0Vote Down
Yesterday, I became a Google employee.I know that there has been quite a hiatus in my MySQL related activities but it wasn't all without good reason. The first proper holiday I have had in a few years.Tomorrow afternoon, I hope to spend some time with Mark Callaghan ... It would be a nice break from the new-employee orientation and tutorials and hopefully a chance to meet more of my new
Video and Presentation now available
+0 Vote Up -0Vote Down
I have updated the Forge page for the External Language Stored Procedures, adding a PDF for the slides used in the presentation and a link to a video of the presentation for those people who missed it. It was quite unfortunate that at the Conference, there were two presentations occurring at the same time which discussed the topic of UDF/Stored Procedures so I am sure that there are people who
After the MySQL Conference and Expo...
+0 Vote Up -0Vote Down
That week at the conference was a busy week for me - as busy as any developer meeting I have had with MySQL in recent years. I had a great time seeing old faces again and it was much like old times talking, chatting and coding with them. In particular, I spent much of my time with Patrick Galbraith, Eric Herman and Arjen Lentz.Great progress was made: I worked with Patrick getting my ancient
UDFs at the MySQL User's conference
+0 Vote Up -0Vote Down
The MySQL User's conference will be held in less than a month from now!!!

This year there is quite a good number of sessions on adding your own functions and procedures, such as:

  [Read more...]
Aggregate Functions with Perl stored procedures.
+0 Vote Up -0Vote Down
I found myself thinking this evening about how someone could set about writing aggregate functions using Perl and on an idle Google search, came across this webpage entitled User-defined Aggregate Functions in DB2 Universal Database.I wondered if a similar technique could be applied for our implementation of External Language Stored Procedures for MySQL. It turns out that the answer is:
These past weeks
+0 Vote Up -0Vote Down
Ever since I submitted the "External Language Stored Procedures" project which Eric and myself have been working on to be listed on FreshMeat, it has gained a small number of interested users and we have just started to get some feedback. Yay! Always nice to know when people are using your code. Okay, so one of the emails contained a feature request: Support for PHP stored procedures. I think I
Stuff since the last update
+0 Vote Up -0Vote Down
The Thanksgiving break was a welcome change of pace... and on the idle driving up and down the Californian coastline, I had a few moments to work on the MySQL External Stored Procedures project. I think I pretty much have Perl functioning fully and a couple of minor problems were resolved.Yesterday, I completed the first draft of the all-revised-from-scratch WL#3771, now titled as the Plugable
10 Minute HOW-TO
+0 Vote Up -0Vote Down
This question seems to crop up again and again... In the words of one comment to my blog: "I've downloaded your External Language Stored Procedures package and am interested in trying out the JAVA part. Would appreciate if you could explain how use the downloaded stuff."Ok, on my download page, I have provided 2 different downloads which are automatically created from our source repository. A
Proposed a talk for UC2008
+0 Vote Up -0Vote Down
Well, we did it. In between his SCRUM meeting and my compiling MySQL on Windows, Eric and I bashed out a proposal for the MySQL Users Conference 2008 and have submitted it. The content of the talk, well... It is entitled "Tour of External language stored procedures for MySQL" and we're going to talk about our little project. On Kaj's blog, he suggests that submissions should be creative,
The context of external language procedure's queries
+0 Vote Up -0Vote Down
Perhaps it wasn't entirely clear what the last posting meant by "reentrant". It means that the external language stored procedure can issue a query within the same thread context that executed the stored procedure. Thanks to the question posed by Bill Karwin, I have tested this scenarios to demonstrate:mysql> lock table mysql.proc write; Query OK, 0 rows affected (0.00 sec) mysql> call test2('
A few fun ideas... XML-RPC as a Stored Procedure.
+0 Vote Up -0Vote Down
Wouldn't it be fun to be able to embed web-service routines into MySQL as if they are stored procedures?
EXTERNAL NAME "xmlrpc://time.userland.com/RPC2;currentTime.getCurrentTime";

Perhaps not a completely useful example... but an interesting goal to achieve. I have written up some code and pushed it to the experimental repository. I haven't tested it yet but I may do later today if I don't get too preoccupied catching up watching NBC's "Heroes". Snapshots created automagically at midnight, Pacific time.
External Language Stored Procedures
+0 Vote Up -0Vote Down
Yay! It's the weekend!

Why does the weekend make me cheerful? I get time to spend on personal projects, although my sweet wife does complain that my 'personal projects' don't look much different than my day job.

This project, I have been doodling with for quite a while. It spawned from a little project that Eric Herman and myself started to look at 2 years ago with what we called "MySQL UDF v2". At the time, it included a whole plug-in and unit testing framework. Since we have to work with what is in the server, we dropped our plug-in and unit test framework after the current MySQL 5.1 plug-in system suddenly appeared: Somehow, I ended up maintaining it but that's another story.

A more modern and sane system for user-defined functions is still our goal. One part of our concept is to minimize the

  [Read more...]
Previous 30 Newer Entries Showing entries 31 to 60 of 65 Next 5 Older Entries

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.