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 91 to 120 of 255 Next 30 Older Entries

Displaying posts with tag: perl (reset)

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...]
Placeholders and SQL injection, part 2
+0 Vote Up -0Vote Down

Actually, what I really wanted to blog about before getting carried away with irony yesterday was an old idea on how to force my developers to use placeholders exclusively for SQL queries in applications. As should be apparent from yesterdays blog entry, I am strongly in favour of using placeholders for interpolating values into SQL queries, due to the great reduction in potential bugs (including, but not limited to, SQL injections).

Basically, wrap the database API so that all database access passes through the wrapper. This can usually be achieved, for example by subclassing DBI (for Perl) and returning such subclasses from the application connection pool, or other similar methods. Probably many large web applications already have such wrappers or use APIs that can be patched or extended appropriately.

Now add code

  [Read more...]
Placeholders and SQL injection
+0 Vote Up -0Vote Down

It is sad to see how 9X% (or should that be 99.X%?) of SQL applications are riddled with SQL injection bugs.

There really is no excuse for this. Nobody writes code like this:

sub stupid_sum {
    my ($list) = @_;
    my $string = shift @$list;
    for (@$list) {
      $string .= " + " . $_;
    }
    my $sum = eval($string);
    return $sum;
}
Right? Just because our computers use the Von Neumann architecture, where CPU instructions and data is stored in the same memory, does not mean that we cannot distinguish between code and data (ok, so in TeX we do not, but there is a reason TeX is not pleasant to write applications in).

So when we use

  [Read more...]
Identify a proxy when automatic configuration script is used
+0 Vote Up -0Vote Down

Many, if not all, corporations control and monitor employees web surfing and email activities. Sometimes a company may choose to use automatic configuration script to enable employees’ web connection. This can be verified by:

  • Internet Explorer: Tools -> Internet Options-> LAN Settings -> “Use automatic configuration script”;
  • Firefox 3: Tools -> Options -> Advanced -> Network -> Settings… -> Automatic proxy configuration URL:

Sometimes you need to know a proxy server name or IP address. For instance, if you use Perl and would like to do an automatic binary install of a module, then you will need to define a proxy for cpan to use. This is the command to do that:

set HTTP_proxy=http://my.proxy.server:8000/

So obviously you need to know a proxy server name

  [Read more...]
DBD::drizzle 0.003 released
+0 Vote Up -0Vote Down
I'm pleased to announce the release of DBD::drizzle 0.003. In this release, I've made many changes, particularly those to get it working with the stock drizzle client library, which is a bit of a moving target, but that's how it goes with new, quickly-evolving projects.

Caveat: This is an Alpha release.

I've added back the tests from DBD::mysql and modified them to work with Drizzle. Some pass just fine, others report 'out of memory'. I hope to figure this out soon, though this is that last version where I'll use the client library that comes with Drizzle. I'll be changing to using Eric Day's improved client library, libdrizzle, and maybe in the process of changing to that, will squash these bugs.

The files:
  file: $CPAN/authors/id/C/CA/CAPTTOFU/DBD-drizzle-0.003.tar.gz
  size: 89682 bytes
   md5:







  [Read more...]
An interview with The Data Charmer.
Employee_Team +0 Vote Up -0Vote Down
By Giuseppe Maxia

The Data Charmer, a.k.a. The Wizard, is a free lance database consultant, with a long career in several IT fields. He is well known for his Perl and SQL expertise,although he is proficient in several other languages, such as C++, shell scripts, and Italian.

He has a split personality, one of which lives in virtual space and time, floating around UTC+1. The other (or the others, as there is a dispute about how many they are) is less documented and some people believe it to be fictional. He teaches Creative Biography at the University of Euphoria, CA (also known as Euphoric State).


G.M. Hello, D.C. Thanks for agreeing to be interviewed. I'll start with a question that most people ask. Who are you?

D.C. This is not really a question I'm willing to answer. Besides, the answer would be  [Read more...]

Libmemcached increment and decrement issue solved
+0 Vote Up -0Vote Down
I spoke with Brian Aker last week about the issues I found with decrement and increment while working on my book "Developing Web Applications with Apache, MySQL, Memcached, and Perl". He suggested I make sure that I was using the latest libmemcached. I checked, and the version of libmemcached that is included with Memcached::libmemcached is 0.21 - this is the version of Memcached::libmemcached I obtained from using CPAN (perhaps CPAN needs a new bundle...). So, I obtained the most recent version of Memcached::libmemcached from the subversion repository at https://perl-libmemcached.googlecode.com/svn, and it includes the lastest libmemcached, version 0.25. To make a long story short, I re-wrote my test script to test each operation individualy and time that, as well as compare the times to Cache::Memcached. The numbers are great and are reason enough  [Read more...]
Libmemcached is faster ...except with increment and decrement (?)
+0 Vote Up -0Vote Down
I'm busy working on my book, "Developing Web Applications with Apache, MySQL, Memcached, and Perl", writing about how Libmemcached (particularly the perl interface to libmemcached, Cache::Memcached::libmemcached/Memcached::libmemcached) is faster. And it is, except when I was writing a test script to compare, I first used Daisuke Maki's script that comes with Cache::Memcached::libmemcached, tools/benchmark.pl (which I modified to only compare Cache::Memcached to Cache::Memcached::libmemcached)

==== Benchmark "Simple get() (scalar)" ====
Rate perl_memcached libmemcached
perl_memcached 6784/s -- -78%
libmemcached 30488/s 349% --
==== Benchmark "Simple get_multi() (scalar)" ====
Rate perl_memcached libmemcached
perl_memcached 1806/s -- -84%
libmemcached








  [Read more...]
Perl Script for Analyze – Optimize – Repair Mysql Databases
+0 Vote Up -0Vote Down
The perl script is mainly created to avoid manual Mysql Server Maintenance. The script uses Perl module DBI. You need to provide access credentials and database name(optional). Regarding Analyse, Optimize […]
Monolith DBA Toolkit 0.4.3 Released
+0 Vote Up -0Vote Down

The Monolith Toolkit of scripts for DBA routines. 0.4.3 has been released. You can download it here: http://code.google.com/p/monolith-toolkit/

Some information on the toolkit and what it contains:

  • mt-backup-parallel -> runs mysql backups in parallel super fast, has lots of reporting features
  • mt-check-replication -> script to report on replication status for slave servers
  • mt-rhcluster-check-filesystems -> reports on redhat cluster filesystems (for mysql active/passive clustering)
  • mt-rhcluster-script-wrapper -> wrapper script for running any of these scripts on a redhat cluster, chooses the active node to run the script on
  • mt-connections-log -> logs connections to mysql to disk, reports on threshold overages
  • mt-flush-tables-sequence -> runs through
  [Read more...]
Seeking volunteer test machines for Monolith
+0 Vote Up -0Vote Down

Monolith: MySQL server monitoring. I only have servers that run Redhat/Debian/Ubuntu Linux x86 and x86_64. I don’t have machines to test MySQL monitoring for the following OSes. Perhaps you would like to be a test candidate for the new version of Monolith? If so, let me know and you’ll be on the list, as well as get beta testing credit.

OSX Server: PPC and Intel

AIX

FreeBSD / OpenBSD / NetBSD

Windows Server

Solaris: Intel & Sparc

Linux servers that are NOT Intel based.

What this involves: testing the client script, perl modules, snmp stats, and other functions that may require a custom client script for that architecture.

mylvmbackup-0.11 has been released
Employee +0 Vote Up -0Vote Down

Some days ago, I released version 0.11 of mylvmbackup a Perl script that performs consistent backups of a MySQL server by using LVM filesystem snapshots. The source archive as well as a generic RPM can be found on the project home page, packages for many Linux distributions are available on the openSUSE Build service.

This release includes some new functionality as well as numerous bug fixes and improvements, most notably:

  • Added support for using rsnap as a backup backend (Matt Lohier)
  • The documentation is now maintained in POD style instead of asciidoc (Matthew Boehm)
  • Support using non-GNU tar
  [Read more...]
mylvmbackup-0.11 has been released
Employee +0 Vote Up -0Vote Down

Some days ago, I released version 0.11 of mylvmbackup a Perl script that performs consistent backups of a MySQL server by using LVM filesystem snapshots. The source archive as well as a generic RPM can be found on the project home page, packages for many Linux distributions are available on the openSUSE Build service.

This release includes some new functionality as well as numerous bug fixes and improvements, most notably:

  • Added support for using rsnap as a backup backend (Matt Lohier)
  • The documentation is now maintained in POD style instead of asciidoc (Matthew Boehm)
  • Support using non-GNU tar
  [Read more...]
The partition helper - Improving usability with MySQL 5.1 partitioning
+0 Vote Up -0Vote Down


I talked several times about partitioning usability. In my many tests of partitioning I found myself in need of generating list of partitions for a given range.
I made the Partition Helper to scratch this particular itch, i.e. making partitions reasonably quickly and without thinking too much.
The Partition Helper is a Perl script that converts some simple options into lots of



  [Read more...]
Maatkit version 2582 released
+0 Vote Up -0Vote Down
Download Maatkit The December release is here! There are some goodies in this release, but the major one is an initial version of mk-log-parser, a slow log analysis tool that is carefully designed (with lots of input from Percona consultants) to make slow log analysis as productive and easy as possible. It’s based on a [...]
Asynchronous MySQL Client in Perl
+0 Vote Up -0Vote Down

I recently found myself wishing for an async library for MySQL. My goal is to be able to fire off queries to a group of federated servers in parallel and aggregate the results in my code.

With the standard client (DBD::mysql), I'd have to query the servers one at a time. If there are 10 servers and each query takes 0.5 seconds, my code would stall for 5 seconds. But by using an async library, I could fire off all the queries and fetch the results as they become available. The overall wait time should not be much more than 0.5 seconds.

While I found little evidence of anyone doing this in practice, my search led me to the perl-mysql-async project on Google Code. It's a pure-Perl implementation of the MySQL 4.1 protocol and an asyncronous client that uses

  [Read more...]
Fifty Percent
+0 Vote Up -0Vote Down
I just uploaded one of my chapters in my book "Developing Web Applications using Perl, Memcached, MySQL and Apache" (Wiley). This was the 50% point. Man, this is a ton of work. Writing a book really takes up every second of your life, which is really hard when there are other projects you maintain - namely DBD::mysql, Memcached UDFs, FederatedX and my interest in helping with Drizzle. I've tried as much as possible to use my projects as material for the book making it possible to do two things at once, as well as make it interesting to write.

It's harder to write on reference material and explaining basic concepts than it is to write about code examples. The code examples I really enjoy because they are first interesting, and secondly there are some tricks and code functionality (particularly with Perl, DBI, stored procedures, etc) that I have never tried out before despite having been writing code

  [Read more...]
DBD::mysql 4.009 Released
+0 Vote Up -0Vote Down
I'm pleased to announce the release of DBD::mysql 4.009! A couple fixes are included with this release:

* Fix to re-enable TAKE_IMP_DATA_VERSION. Still have to ensure DBI version 1.607 or higher in the test suite (Daniel Frett, myself)
* Fix to escaped single quotes throwing off bind param detection. Patch from Zhurs (zhurs@yandex.ru -- Spasibo!), new test modified to use Test::More (myself)

Thanks/Spasibo for the help from Daniel Frett and Zhurs as well as all those who report bugs!

The file:

The uploaded file

DBD-mysql-4.009.tar.gz

has entered CPAN as

file: $CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.009.tar.gz
size: 125168 bytes
md5: 1115dcc2560191bfaed09baf6aa7e183

Found at:

http://search.cpan.org/~capttofu/DBD-mysql-4.009/

Enjoy!
DBD::mysql on OS X Quirks: Architectures, MySQL Binaries and the Filesystem
+0 Vote Up -0Vote Down

Yesterday evening, a friend of mine had some issues with installing DBD::mysql, and asked if I had encountered the same issue. The problem, as the output from make test showed, was that certain symbols was missing:

#     Tried to use 'DBD::mysql'.
#     Error:  Can't load '/Users/westerlund/src/perl/DBD-mysql-4.008/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/westerlund/src/perl/DBD-mysql-4.008/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Symbol not found: _is_prefix

Fair enough, this is related to a 64-bit issue with MySQL—at least with my Perl version, which is now:

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  Platform:
    osname=darwin, osvers=9.5.0, archname=darwin-thread-multi-64int-2level

If you try to link to a x86_64

  [Read more...]
mylvmbackup 0.10 has been released
Employee +0 Vote Up -0Vote Down

I am happy to announce that mylvmbackup version 0.10 has been released.

You can download the updated package from the project home page or via the openSUSE Build Service.

This version fixes some bugs and includes new functionality:

  • Applied patch from Marc Haber: added option --keep_snapshot that will skip the removal of the backup snapshot before terminating the script. Providing the option --backuptype=none will now skip creating a backup using the builtin backup modules. Both options provide more flexibility when using hooks for performing the actual backup tasks or when the snapshot is considered to be the actual backup.
  • Added two new hooks: "backupsuccess" and "backupfailure" which are called respectively upon success of failure of the backup operation (
  [Read more...]
mylvmbackup 0.10 has been released
Employee +0 Vote Up -0Vote Down

I am happy to announce that mylvmbackup version 0.10 has been released.

You can download the updated package from the project home page or via the openSUSE Build Service.

This version fixes some bugs and includes new functionality:

  • Applied patch from Marc Haber: added option --keep_snapshot that will skip the removal of the backup snapshot before terminating the script. Providing the option --backuptype=none will now skip creating a backup using the builtin backup modules. Both options provide more flexibility when using hooks for performing the actual backup tasks or when the snapshot is considered to be the actual backup.
  • Added two new hooks: "backupsuccess" and "backupfailure" which are called respectively upon success of failure of the backup operation (
  [Read more...]
Maatkit version 2325 released
+0 Vote Up -0Vote Down
Download Maatkit There’s a new release with a lot of goodies — speed, efficiency, user-friendliness, and new features. In particular some of Percona’s clients have sponsored features for things they need such as the ability to more frequently verify that slaves are in sync with their masters. If you need features, please ask Percona [...]
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.
Perl/mod_perl/DBI/etc: To thread or not to thread
+0 Vote Up -0Vote Down
Here's a question I posted to the DBI as well as mod_perl mailing list that I thought would be also a good question to ask here:

Hi all,

I'm currently working on... of all things, a book on book about web app programming with Perl/Apache/MySQL, and I'm trying to explain what Ubuntu packages to use for installation (and I'm sure other Linux variants same applies)

Ubuntu gives you:

apache2-mpm-prefork
apache2-prefork-dev
apache2-mpm-worker
apache2-threaded-dev

I've used both prefork and worker (as of late, due to concerns with perl and threads), both of which seem to work fine. Though, the DBI documentation warns of caveats of using threaded, especially if the client is not thread safe (I always compile mysql with a thread-safe client, and DBD::mysql against that thread safe client).

So... I'm trying to decide if I should














  [Read more...]
MySQL University Session tomorrow: OpenSolaris Web Stack
Employee +0 Vote Up -0Vote Down

Tomorrow (Thursday, 11th of September) at 9:00 PST/16:00 UTC/17:00 GMT/18:00 CET, there will be an new free MySQL University Session. MySQL University started as an internal training program for MySQL engineers, to share and spread knowledge about their areas of expertise and has been available to the public for quite some time now. It covers a wide range of technical topics around the MySQL Server and usually takes place once per week.

For the first time, the presentation will not be performed by (former) MySQL employees/developers, but by two of our "Sun Classic" colleagues: Jyri Virkki (OpenSolaris Web Stack

  [Read more...]
The Perl UTF-8 and utf8 Encoding Mess
+0 Vote Up -0Vote Down

I've been hacking on some Perl code that extracts data that comes from web users around the world and been stored into MySQL (with no real encoding information, of course). My goal it to generate well-formed, valid XML that can be read by another tool.

Now I'll be the first to admit that I never really took the time to like, understand, or pay much attention to all the changes in Perl's character and byte handling over the years. I'm one of those developers that, I suspect, is representative of the majority (at least in this self-centered country). I think it's all stupid and complicated and should Just Work... somehow.

But at the same time I know it's not.

Anyway, after importing lots of data I came across my first bug. Well, okay... not my first

  [Read more...]
The ephemeral glory of books
+0 Vote Up -0Vote Down
A picture says it all. Special offers at a FrOSCon books booth.
For how long is an IT book in its prime?
How Maatkit benefits from test-driven development
+0 Vote Up -0Vote Down

Over in Maatkit-land, Daniel Nichter and I practice test-first programming, AKA test-driven development. That is, we write tests for each new feature or to catch regressions on each bug we fix. And — this is crucial — we write the tests before we write the code.* The tests should initially fail, which is a validation that the new code actually works and the tests actually verify this. If we don’t first write a failing testcase, then our code lacks a very important guarantee: “if you break this code, then the test case will tell you so.” (A test that doesn’t fail when the code fails isn’t worth writing.)

Most of the time when I do this, I write a test, it fails

  [Read more...]
DBD::mysql 4.008 released
+0 Vote Up -0Vote Down
I'm pleased to announce the release of DBD::mysql 4.008!

This release contains several fixes, particularly the issue where TAKE_IMP_DATA_VERSION being defined allowed code features to be compiled in that caused potential grief for anyone running DBI < 1.60x (segfault). I've disabled this for the time being until I find a better solution.

I've also decided from now on, as soon as I get a patch, or if I fix something, even if it is a minute change, I'm rolling out a release. Release early and often, right!?

The changes in this release are:

* Multi statement patch (fixes multi statement issues), thanks to Chris Heath!
* Disabled TAKE_IMP_DATA_VERSION because segfault with DBI < 1.607
* #29528: bind_param(..., SQL_FLOAT) ignores exponents - fixed, Thanks to
Tokuhiro Matsuno!
* Cleanups to make mysqlEmb work under Cygwin - Thanks to Chris











  [Read more...]
Recent additions to my openSUSE Build Service repository
Employee +0 Vote Up -0Vote Down

I recently added two new packages to my repository on the openSUSE Build Service:

  • Maatkit is a collection of essential command-line utilities for MySQL. Each is completely stand-alone, without dependencies other than core Perl and the DBI drivers needed to connect to MySQL, and doesn't need to be "installed" - you can just execute the scripts. This makes the tools easy to use on systems where you can't install anything extra, such as customer sites or ISPs.
  • protobuf - Protocol Buffers - Google's data interchange format. Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google
  [Read more...]
Previous 30 Newer Entries Showing entries 91 to 120 of 255 Next 30 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.