Showing entries 33246 to 33255 of 44804
« 10 Newer Entries | 10 Older Entries »
in_array is quite slow

So, we had a cron job hanging for hours.  No idea why.  So, I started debugging.  It all came down to a call to in_array().  See, this job is importing data from a huge XML file into MySQL.  After it is done, we want to compare the data we just added/updated to the data in the table so we can deactivate any data we did not update.  We were using a mod_time field in mysql in the past.  But, that proved to be an issue when we wanted to start skipping rows from the XML that were present but unchanged.  Doing that saved a lot of MySQL writes and sped up the process.

So, anyhow, we have this huge array of ids accumulated during the import.  So, an in clause with 2 million parts would suck.  So, we suck back all the ids in the database that exist and stick that into an array.  We then compared the two arrays by looping one array and using in_array() to check if the value was in the …

[Read more]
Perspective: Addons and Community site

Along with evolving and documenting interface for writing Workbench plugins we think about community site which will make sharing and usage of plugins within community extremely easy. Conceptually it will be close to addons.mozilla.org. Users will be able to explore directory of published addons, read description and comments on them, quickly install and rate whatever they consider necessary. To install selected addon user will have just to drag’n'drop corresponding link to Workbench, and the rest will be done by Workbench. Every addon will be supplied with manifest file describing its version, dependencies on other addons (if any), files to be installed, menu items to be added, etc. Addon has wide definition, it could be a plugin (dynamic library), set of demo models, documentation, SQL scripts, whatever. Now things are nearly in the middle of development stage. If you have ideas on how to improve the process of …

[Read more]
Grouping .test files into suites

Please, enlighten me on what being in a separate suite means! I see there is a suite directory in mysql-test. Will the suites be run by default when I use 'mtr' to run tests? Or do I have to add them manually?
=========================================

The number of tests we have for MySQL Server are constantly growing. There is a need to group them in different ways so we can select what and where to run. We do this by using suites, either the default suite that we call "main" in mysql-test/t or one of the subdirs of mysql-test/suite.

As each test becomes more advanced it's also necessary to use different configurations for a particular test or suite. For example all the replication tests in suite/rpl need to be run with the server started in three different ways(three different configurations) to get full coverage. To avoid that the individual developer or the "one" running tests have to remember different …

[Read more]
How to concatenate strings in a mysqltest testcase

Hi Magnus, is there a way to concatenate strings in a mysqltest?
=================================================================


Yes, you can "easily" create more dynamic strings using let and a while loop. For example like this:


let $c= 254;
let $str= t255;

while ($c)
{
let $str= t$c,$str;
dec $c;
}
echo $str;



This will printout t1, t2, t3, ... t255.


You can then use the $str variable in an eval
to CREATE TABLE, VIEW or SELECT


eval CREATE TABLE t0 (a INT) ENGINE=MERGE UNION($str);
Memo: Binary Logging of MySQL from the viewpoint of storage engine
  • two formats: statement-based and row-based
    • can be mixed
    • 5.1 supports both
  • statent-based logs record UPDATE,INSERT,DELETE queries
  • row-based logs store internal buffers passed to `handler' class
  • storage engines may declare HA_HAS_OWN_BINLOGGING and write to binlog directly
    • however, it becomes impossible to log multitable updates
    • what happens if the storage engine supports transaction?
  • handling of auto_increment
    • when using statement-based logs, lock for auto_increment value should be held until a query completes
    • when using row-based logs, an auto_increment column can be updated and stored to log one row by row by directly updating ``uchar record[]''

For myself, since …

[Read more]
replicants

I found myself with some spare time the other day and decided that my current mysql backup strategy is not the best in the world. The mysql server is a virtual machine in a Brisbane datacenter and it's backed up via a script that calls mysqldump on each installed database and dumps the content to (compressed) files. These files then get sucked down via rdiff-backup.

This is fine in principle, but does mean it's possible for me to lose 24 hours worth of data due to an accidental '--; DROP table students.

A more ideal way would be for the remote sql server to replicate to a local one, on which I can run mysqldump more often without affecting web site performance. (Replication would replicate the DROP table statement too.. :-)

With a bit of a confluence of attending three days of OpenQuery mysql training and needing to regenerate all ssl keys, I thought I should …

[Read more]
replicants

I found myself with some spare time the other day and decided that my current mysql backup strategy is not the best in the world. The mysql server is a virtual machine in a Brisbane datacenter and it's backed up via a script that calls mysqldump on each installed database and dumps the content to (compressed) files. These files then get sucked down via rdiff-backup.

This is fine in principle, but does mean it's possible for me to lose 24 hours worth of data due to an accidental '--; DROP table students.

A more ideal way would be for the remote sql server to replicate to a local one, on which I can run mysqldump more often without affecting web site performance. (Replication would replicate the DROP table statement too.. :-)

With a bit of a confluence of attending three days of OpenQuery mysql training and needing to regenerate all ssl keys, I thought I should …

[Read more]
Confusing MySQL Replication Error Message

I already wrote about some MySQL Error Messages which are confusing, here is one more:

PLAIN TEXT SQL:

  1. 080603 20:53:10 [Note] Slave: connected TO master 'repl@host.com:3306',replication resumed IN log 'master-bin.003676' at position 444286437
  2. 080603 20:53:10 [Note] Slave: received end packet FROM server, apparent master shutdown:
  3. 080603 20:53:10 [Note] Slave I/O thread: Failed reading log event, reconnecting TO retry, log 'master-bin.003676' position 444292333
  4. 080603 20:53:10 [Note] Slave: connected TO master 'repl@host.com:3306',replication resumed IN log 'master-bin.003676' at position 444292333
  5. 080603 20:53:10 [Note] Slave: received end packet FROM server, apparent master shutdown:
  6. 080603 20:53:10 [Note] Slave I/O thread: Failed reading …
[Read more]
What Does Open Source Mean?

At last night’s event, a lot of the questions were really implicitly asking, “Is open source better? Why?”

The first answer everyone comes up with is that it’s free, and that’s better.

However, that is neither necessary nor sufficient to deem it “better”.

If MySQL did exactly the same tasks Oracle did, but was free, there’s still a huge amount of money involved when migrating. Merely staffing the migration costs a lot of money.

Companies using open source technologies because they are free are (probably) making the right software choice for the wrong reason.

Firstly, open source does not have to be free — MySQL proves that. Their Enterprise source code is free to paying customers (and whoever paying customers distribute to, but that is not the issue).

Secondly, open source’s benefits far outweigh mere license costs, though the license cost is definitely the most tangible …

[Read more]
MySQL Focuses on Community

Post Summary: An apology with a lesson.

When Steve Curry contacted me just after the MySQL Conference and Expo asking me if I’d be interested in a community roundtable, I was excited. Not just because Steve Curry brought me an inflatable pink dolphin after I squee‘d that I needed one, although I never forget when someone does me a favor.

However, a few weeks ago it seemed like the event was more of a PR gathering than a community roundtable. I was disappointed, and told Steve as much.

And then, one of two things happened:

1) My concerns were brought up, discussed and folks decided a roundtable involving community was a good idea;
or
2) I had come up with two different pictures of the event in my mind, based on my expectations of “community roundtable” at first and “event with businesses and PR, to include …

[Read more]
Showing entries 33246 to 33255 of 44804
« 10 Newer Entries | 10 Older Entries »