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 63 Next 3 Older Entries

Displaying posts with tag: plugins (reset)

Python Scripting in Workbench
Employee_Team +0 Vote Up -0Vote Down

Python support has been added to the latest version of MySQL Workbench.

In addition to Lua, you can now write scripts and modules or interact with the GRT shell using the Python language. The integration allows you to use GRT objects and modules mostly in the same way you would do with normal Python objects. The built-in grt module contains everything related to the GRT that’s exposed to Python, including:

  • custom types for GRT lists, dicts and objects
  • wrappers for GRT classes, that can be used and instantiated as a normal Python class;
  • wrappers for registered GRT modules, that can be used like normal modules;
  • a reference to the root node of the GRT globals tree;

You can inspect these objects with the standard dir() command and in some cases with help(), to access

  [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...]
MySQL Workbench - LUA-Script For Batch Renaming Of Foreign Keys
Employee_Team +0 Vote Up -0Vote Down

Yesterday there was a short discussion on our public IRC channel (#workbench on freenode). It was about how Workbench handles Foreign-Key-Names.

Especially if you intend to use Synchronization feature (available in SE edition only) its good to have names for FKs (and their coresponding Indices). Workbench does that by default if you’re using the Relationship-tools (Hotkeys 1 to 6 when canvas is focused). But if you prefer to create your FKs in a not-so-visual way (entering the values on the FK-Tab in the table-Editor) you are on your own when it comes to naming your FKs. Though Workbench initially only accepts creating keys after you typed a name into the name-field theres still the possibility to rename the FK later to even empty names. If you try to create empty named FKs on a MySQL Server the server will generate a name for the key.

If you want to change FK names later, when your model

  [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 (
Workbench Plugin Tutorial: Load INSERTs from a File
Employee_Team +0 Vote Up -0Vote Down

A couple of people have asked for a means to set the list of INSERT statements of a table from data already in an external file. While we haven’t implemented that feature in Workbench as of now, that’s something that can be easily added as a Lua plugin.

The plugin is really simple, but I’ll take the opportunity to use it as a quick tutorial on how to write a plugin from scratch, using the mini-IDE in Workbench 5.0  Note that this tutorial is meant for MySQL Workbench 5.0; Workbench 5.1 has some differences in how plugins are handled and that is not covered here.

1.  Start Workbench and Open the “GRT Shell IDE”

2. Click on “New GRT File” button

3. Select the “Lua GRT Module File” option, “Table_Plugin” template and fill in a name for the file, eg: table_utils

  [Read more...]
A Utility Library for MySQL Workbench
Employee_Team +0 Vote Up -0Vote Down

Here is a small library with various helpful Lua functions for scripts and plugins for Workbench, making it easier to write your own plugins for exporting to some external format, generating reports etc. The library is meant for Workbench 5.0, but it will be ported to 5.1 as well, which should make transitioning plugins from one to the other somewhat easier in the future. Currently, most functions are meant for iterating through various objects so you can, but new functions will be added every once in a while and contributions, bug fixes and comments are welcome. To “install” the library, place the file in your equivalent for C:\Documents and Settings\user\Program data\MySQL\Workbench\librariesQuick list of places to get useful information for plugin writing:

  • the Structs list will list the available

  [Read more...]
Automate Figure Arrangement In Workbench
Employee_Team +0 Vote Up -0Vote Down

Initiated by a question on the forum I took some time to exercise my Workbench-Scripting-Knowledge. The question was, if it’s possible to do some figure-arrangement/organizing via scripts. To be more precise, the task I had to master was to get tables that have names starting with a given prefix moved into a new layer using scripts.

The function to create a new object - layer in this case - was an easy one. All you have to do is to use the function grtV.newObj(”workbench.model.Layer”). This function returns a handle to the created Layer. Finally, set the visual properties (color, position) and most important, the owner has to be set to the containing Diagram-object. Last step is to add the layer to the “layers” property of the Diagram-object.
The second step, which i put into a separate function, is to ask the user for the prefix to filter the desired tables/objects

  [Read more...]
Re: For Internal Use Only - FAIL
+0 Vote Up -0Vote Down
In response to Monty Taylor's blog post ...I am the culprit for the content of plugin.h which has the comment "the following declarations are for internal use only" which was introduced into the MySQL server codebase a couple of years ago.Unfortunately, I had to work with the limitations of the C programming language and its preprocessor so to achieve a solution which behaved as if it had the
Amira has landed
+0 Vote Up -0Vote Down
What or who is Amira?Well... Many would know Amira is to David as My is to Monty.Amira also has all the same letters as Maria, except that it is in PDP "middle-endian" byte order.It is also the codename of a little known project while I was at MySQL: Soon after Oracle acquired Innobase OY, the powers that be at MySQL did not want to solely rely on InnoDB (or BerkeleyDB) as a transactional data
MySQL plugins - the missing plug.in manual page.
+0 Vote Up -0Vote Down
A whole bunch of people have successfully written plugins for MySQL using the plug-in framework which first appears in MySQL 5.1. On the whole, the simple examples work great, as long as all your code is in one directory. Here is a helpful tip...Inside the plug.in file, you can use MYSQL_PLUGIN_DIRECTORY_<FOO> as an alias to the directory in which your plug.in is located within, where FOO is the
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.
New UDF for MySQL 5.1 provides GIS functions distance_sphere() and distance_spheroid()
Employee +0 Vote Up -0Vote Down

In case you are processing and working with geospatial data on MySQL, you may be interested in the following UDF (plugin) for MySQL 5.1: Koji Okumura from Oki Labs Japan has ported two functions from PostGIS into a MySQL UDF:

  • distance_sphere(point, point): Returns linear distance in meters between two lat/lon points. Uses a spherical earth and radius of 6370986 meters. Faster than distance_spheroid(), but less accurate. Only implemented for points
  [Read more...]
New UDF for MySQL 5.1 provides GIS functions distance_sphere() and distance_spheroid()
Employee +0 Vote Up -0Vote Down

In case you are processing and working with geospatial data on MySQL, you may be interested in the following UDF (plugin) for MySQL 5.1: Koji Okumura from Oki Labs Japan has ported two functions from PostGIS into a MySQL UDF:

  • distance_sphere(point, point): Returns linear distance in meters between two lat/lon points. Uses a spherical earth and radius of 6370986 meters. Faster than distance_spheroid(), but less accurate. Only implemented for points
  [Read more...]
Pimp My Workbench
Employee_Team +0 Vote Up -0Vote Down

Some weeks ago there was a request about adding a feature that keeps (or gets) datatypes of colums, which are connected via foreign keys, in sync. While we have added this to our ToDo list, I thought of doing some simple LUA exercises to give the user at least a funtion to check if the FKs in the model all have columns with matching datatypes.
As it turned out such tasks can be done quite easily using our GRT-shell. And by writing some functions you can add features to Workbenchs interface.

To get in touch with the shell/GRT environment inside Workbench click the tiny black prompt-window-icon in the top right area of workbench (or choose ‘View->Advanced->GRT Shell’ from the main menu).  Some items in the UI are swapped/added: the sidebar on the right side gets a new tab named ‘GRT Shell’ featuring some more tool-panes (GRT Tree, Modules, Inspector) and on the bottom


  [Read more...]
Using Plugins in MySQL™ 5.1
+0 Vote Up -0Vote Down
[HoneyMonitor is a GUI for MySQL™. Server Administration, Database and Database Objects Administration, Code Development, Server Monitoring, Performance Monitoring, Performance Auditing. Read more on http://www.honeysoftware.com/]

This is a short tutorial on the features implemented in HoneyMonitor for the use and administration of Plugins. It could be useful for Users who are new to the product and want to get start with it or to whom want to learn the basis of Plugins in MySQL™ 5.1

More details on the HoneyMonitor Reference Manual at http://www.honeysoftware.com/honeymonitor/doc.

Contents

  • Introduction
  • Plugins Metadata
  • Retrieving the list of Plugins
  • The Plugins
  [Read more...]
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
MySQL Workbench: Lua Plugin Support
Employee_Team +0 Vote Up -0Vote Down

The Lua plugin support has been finally fixed and will be working in the next release. Together with a few other improvements, it’s now possible to write your own commands to do all kinds of tasks. Documentation for the plugin system is not yet written (and the previous one is outdated), but it should be straightforward to copy the supplied Lua plugin and change it to do something else. All you need is to know a little Lua (which is a simple scripting language) and explore Workbench internals using the GRT Shell (View -> Advanced -> GRT Shell).The sample Lua plugin is located in the modules folder. You can copy it to the custom plugins folder which is shown in the GRT Shell at startup and change things like the module name and add your own functions. I’ll write more about how to write such functions in a future post, like after the next WB is actually

  [Read more...]
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
MySQL Archiver can now archive each row to a different table
+0 Vote Up -0Vote Down

One of the enhancements I added to MySQL Archiver in the recent release was listed innocently in the changelog as "Destination plugins can now rewrite the INSERT statement." Not very exciting or informative, huh? Keep reading.

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,
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?
CREATE FUNCTION xml_current_time() RETURNS DATETIME NO SQL
LANGUAGE XMLRPC
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.
Re: Gemini, Forgotten about this one aye?
+0 Vote Up -0Vote Down
Brian mentioned Gemini on his blog... As many people remember, there was a stunned silence for a while when Oracle purchased InnoBase OY only 2 years ago... Very similar to the stunned silence about 6 years ago when the suits at NuSphere tried to do a SCO. Back on to the topic at hand... Gemini. About two years ago, Brian fed me a copy of the Gemini engine saying that "Hey, you remember Gemini? Here's the code. Get it working. Don't talk about it and call it 'Amira'.". Perhaps not exactly his words but close enough.

So the Amira project had a shaky beginning... I ported the code to work on MySQL 5.0 and started examining it, removing platform-specific code, and improving the performance of it. From the first working run to the last, I think performance improved by about a factor of 10 but I don't remember

  [Read more...]
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...]
Update on XML_RPC
+0 Vote Up -0Vote Down
Wow, it actually worked with only minor changes to the code. Check this out:

mysql> create function xml_get_state(id int) returns text
-> no sql language xmlrpc external name
-> 'xmlrpc://betty.userland.com/RPC2;examples.getStateName';
Query OK, 0 rows affected (0.00 sec)

mysql> select xml_get_state(40);
+-------------------+
| xml_get_state(40) |
+-------------------+
| South Carolina |
+-------------------+
1 row in set (0.42 sec)

Now I just need to check that it works for more complex resultsets... Trawl the web for open-access trivial XML-RPC services or build a test XML-RPC server?
Reentrant MySQL with External Stored Procedures
+0 Vote Up -0Vote Down
Ok, this is a late late blog post because the code was done and pushed into the work tree not last weekend, but the weekend before. I think it is a pretty significant feature to blog about but for some strange reason, it completely slipped my mind. Check this out:mysql> call test2('select count(*) from mysql.user; select count(*) from mysql.proc'); +----------+ | count(*) | +----------+ | 3
+0 Vote Up -0Vote Down
What a surprisingly busy week.

Spent quite a lot of time tracking down a linking problem on Itanium. It appears that GNU ld 2.14 has some serious deficiencies. GNU ld 2.17 (the current stable release) does fix the problem. Unfortunately, the last supported version of GNU ld on RedHat AS 3 for Itaniam is version 2.14.90.0.4.20030529 - which clearly cannot contain the fix which was written in November of 2003. I suppose what to do is now a decision to be made by someone else.

Also spent some time with Federated - Bulk insert support within the storage engine and also how to make Federated play better with transactions and network overhead. Have to put together a new WorkLog entry if I cannot find a relevant one. I need to work on writing better changeset comments. Ingo says, and I have to admit that I agree a bit, that my comments assume that the reader is



  [Read more...]
Been busy,
+0 Vote Up -0Vote Down
I have been very busy this past months, with both personal crisis and mega-patches. This is my MySQL blog so lets keep it to topic.
A couple of weeks ago, the plugins mega-patch was finally pushed and was released to the world in version 5.1.18. Thanks to Ingo and Sergei for keeping up the effort while I was occupied. As part of the code push, InnoDB code was stripped out of the main mysqld code and stored where it belongs, within Innobase's code. This is an exciting development as it now makes it easier than ever for plugin developers to create plugins without having to modify any existing code within mysqld. It has taken many months to get to this point but we are finally there. Anyone remember our CEO announcing the plugin initutive back when Innobase was acquired by Oracle? October 2005, I believe.

Since that push, I am back on bug-fixing... I have an annoying bug on Itanic with


  [Read more...]
+0 Vote Up -0Vote Down
It has been very productive this week working at Brian's place in Seattle. No sightseeing this trip but had an enjoyable experience talking with other developers and users at the MySQL meetup session.
I have been working on developing a flexible Log Plugin system which hopefully does not have the drawbacks of the existing system. The new code seems to be working well now although it is not tied into any system variables in a way to show off what it can do. My patch earlier on Wednesday replaced about 2500 LOC with about 500. Even after the code written today, there is still a significant reduction in the overall code size. Now, all I need is my plugin server variables patch pushed...
Previous 30 Newer Entries Showing entries 31 to 60 of 63 Next 3 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.