Showing entries 21 to 30 of 37
« 10 Newer Entries | 7 Older Entries »
Displaying posts with tag: lua (reset)
More fun with LUA - Introducing Log4LUA

UPDATE Log4LUA 0.2 released. Go to the project page.

After the dust about backend connection handling in MySQL Proxy had settled, I begun working on other parts of HSCALE again. (I’ll return to the backend handling later after talking to Jan Kneschke about their plans.)

One of the issues that bothered me the most was logging. Until now I just had used a simple debug function that could be enabled or disabled using an environment variable. The pretty straightforward approach a lot of people use. But there is more to logging than to print debug messages. So I searched the web and of course I found …

[Read more]
Building mysql-proxy-0.6.0 on CentOS-5.2

I recently needed to configure mysql failover on some of our test machines. Thanks to Sheeri’s helpful blog entry which provides a simple failover lua script, configuring failover is a simple matter. However, the machines are running centos-5.2 and centos doesn’t provide an rpm for mysql-proxy. This blog entry describes how to build your own.

The latest mysql-proxy (0.6.1) is apparently not backward-compatible with 0.6.0 and earlier. It incorrectly handles the case when one of the backend machines is down. Instead of just marking it as down, it errors out completely. This makes it rather difficult to use it for failover scenarios. People have complained about this for a while. Bugs 34793 and …

[Read more]
Lua: Using LPEG for SQL Indenting

I have a somewhat strange relation to parser since a while. Like everyone I started with writing little parsers by hand and bounced several times against yacc and flex failing to get around their very own syntax.

Then I discovered lemon and used it in lighttpd for the configuration and HTTP parsing, finally a parser syntax I could read. But it still was a split between lexing and parsing.

Along the the way there was ragel with its wonderful dot-output to visualize its state-engine, very neat and a mixed lexer and parser.

2-3 weeks ago I finally stumbled over LPEG and I'm happily writing parsers now. Like a simple one that can parse complex SELECT queries and …

[Read more]
MySQL Proxy Lua scripts cannot be written as a module?

Yesterday I went through hell while testing the MySQL Proxy partition Lua scripts I am working on in a high concurrency environment. I am sending multiple queries to the server and build up a combined result set in read_query_result - something like this. The proxy returned weird results complaining about multiple result sets being sent from time to time at totally different places even though I was sure that for each query only one result set has been sent. And some of the results were just wrong, a lot of our tests failed unexpectedly.

After long hours flicking almost every switch I simply removed the Lua module declaration from the main LUA script passed to the proxy via proxy-lua-script since it was the only thing left that …

[Read more]
Playing arround with the MySQL-Proxy on Mayflower-barcamp

One of the workshops on our Barcamp two weeks ago had to do with the MySQL-Proxy from Jan Kneschke.

Yet, we found out, that the proxy is rather unuseable for our task. Read here why.


Continue reading "Playing arround with the MySQL-Proxy on Mayflower-barcamp"

new responsibility

while we start to wind up development of connector/odbc 5.1, i will also be taking on responsibility for libmysql, the c library that defines the client interface to mysql, and the mysql command-line utilities. there are about 120 active bugs in those areas right now, so the first task will be getting that down to a more manageable number.

after that, the field will open up for new development. i know that an asynchronous interface to libmysql is on some people’s wishlist, and there are other areas where i think that libmysql could be cleaned up in general.

but the idea that i think is the most exciting is to build a scripting …

[Read more]
MySQL Workbench: Lua Plugin Support

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 released.There are a few ways that plugins …

[Read more]
Replacing Autotools

In the last round I wanted to replace everything with a lua implementation. Today, I want to take a step back and only replaces the autotools :)

On one side this follows the idea of cmake a bit more and on the other side it takes in account that make is isn't the evil guy here. Let make do the make job, let lua generate the makefile.

Ok, to put it in other words: we don't care who is building our code in the end. May it be Prime Mover, gnu make or nmake on windows.

It turns out that this task is more tricky in the end. Especially if you are crazy and want to build it Makefile.am files. Yes, the Makefile.am from automake as input to generate the Makefile. For now I go the route of a central Makefile that has everything (somewhat following the "Recursive Makefile considered Harmful" paper).

Let's see how much this hurts.

Get ready for the MySQL University lecture on Lua

On December 13 (it means today for most of the readers) at 15:00 CET (14:00 UTC), the MySQL University lecture on Lua will start.
The topic is quite extensive. Even though the lecture is limited to using Lua with MySQL Proxy, yet there is a lot of ground to cover. During a rehearsal session last week, I realized that the whole matter would need much more than one hour if I describe in detail all the introductory material that I originally planned.
So I will reduce the time dedicated to MySQL Proxy architecture, which you can look on your own by reading Getting started with MySQL Proxy. I will cover this matter only briefly during the lecture, so if you know some background, you’ll enjoy the lecture even more.

If you are new to MySQL University lessons, …

[Read more]
Lua: luaL_loadfile_factory()

I just implemented a script-cache for MySQL Proxy and had to learn a bit more about lua internals. As a result I wrote two functions which are generic enough for general consumption:

  • luaL_loadfile_factory()
  • luaL_loadstring_factory()

They also show how to write a lua_Reader for lua_load().

The #lua channel on freenode was a great help, as always.

LUA provide several loaders:

  • luaL_loadstring
  • luaL_loadbuffer
  • luaL_loadfile

and you can create your own if you have to.

Now, why the need for a new loader ?

The proxy we have

  • a global scope caches the scripts
  • this cache reloads the scripts if they changed on disk
  • each thread executes the same script
  • each thread has its own …
[Read more]
Showing entries 21 to 30 of 37
« 10 Newer Entries | 7 Older Entries »