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 121 to 150 of 150

Displaying posts with tag: code (reset)

Fun with the 387
+0 Vote Up -0Vote Down

Filed  GCC bug 39228:

#include <stdio.h>
#include <math.h>
int main()
{
        double a= 10.0;
        double b= 1e+308;
        printf("%d %d %dn", isinf(a*b), __builtin_isinf(a*b), __isinf(a*b));
        return 0;
}

mtaylor@drizzle-dev:~$ gcc -o test test.c
mtaylor@drizzle-dev:~$ ./test
0 0 1
mtaylor@drizzle-dev:~$ gcc -o test test.c -std=c99
mtaylor@drizzle-dev:~$ ./test
1 0 1
mtaylor@drizzle-dev:~$ gcc -o test test.c   -mfpmath=sse -march=pentium4
mtaylor@drizzle-dev:~$ ./test
1 1 1
mtaylor@drizzle-dev:~$ g++ -o test test.c
mtaylor@drizzle-dev:~$ ./test
1 0 1

Originally I found the simple isinf() case to be different on x86 than x86-64, ppc32 and sparc (32 and 64).

After more research,












  [Read more...]
Contributing Code to MySQL -- Some Simple Guidelines
Employee +0 Vote Up -0Vote Down

If you would like to contribute to MySQL development, you can read the relevant top-level page on the MySQL Forge.

This page has some useful links to various forms of contributing to MySQL, including contribution of code to MySQL. (The MySQL|Sun team have recently simplified some of these pages in order to make them more useful to community members and potential contributors.)

Note that after some simple paperwork submitted to Sun ("Sun Contributor Agreement" or "SCA"), any


  [Read more...]
Contributing Code to MySQL -- Some Simple Guidelines
Employee +0 Vote Up -0Vote Down

If you would like to contribute to MySQL development, you can read the relevant top-level page on the MySQL Forge.

This page has some useful links to various forms of contributing to MySQL, including contribution of code to MySQL. (The MySQL|Sun team have recently simplified some of these pages in order to make them more useful to community members and potential contributors.)

Note that after some simple paperwork submitted to Sun ("Sun Contributor Agreement" or "SCA"), any


  [Read more...]
Contributing Code to MySQL -- Some Simple Guidelines
Employee +0 Vote Up -0Vote Down

If you would like to contribute to MySQL development, you can read the relevant top-level page on the MySQL Forge.

This page has some useful links to various forms of contributing to MySQL, including contribution of code to MySQL. (The MySQL|Sun team have recently simplified some of these pages in order to make them more useful to community members and potential contributors.)

Note that after some simple paperwork submitted to Sun ("Sun Contributor Agreement" or "SCA"), any


  [Read more...]
Golden Rules for Contribution-based Communities
Employee +0 Vote Up -0Vote Down

There are some basic, golden rules when it comes to having a vibrant community of contributors.

The following are rules I have extracted and learned based on my experience managing and working with engineers actively involved and participating in the Apache/Derby, PostgreSQL and MySQL open-source communities. These rules are also based on extensive discussions with many folks involved with the MySQL community, with the PostgreSQL community and with the Apache/Derby (Java DB) community, over many years.

Before I go through these rules, I would like to thank Marten Mickos for having suggested some of the headings for these rules. (I originally had much longer headings for all of them.) I would also like to thank many of MySQL, PostgreSQL and Java DB colleagues, as well as to many other colleagues involved in open-source development, for having

  [Read more...]
Golden Rules for Contribution-based Communities
Employee +0 Vote Up -0Vote Down

There are some basic, golden rules when it comes to having a vibrant community of contributors.

The following are rules I have extracted and learned based on my experience managing and working with engineers actively involved and participating in the Apache/Derby, PostgreSQL and MySQL open-source communities. These rules are also based on extensive discussions with many folks involved with the MySQL community, with the PostgreSQL community and with the Apache/Derby (Java DB) community, over many years.

Before I go through these rules, I would like to thank Marten Mickos for having suggested some of the headings for these rules. (I originally had much longer headings for all of them.) I would also like to thank many of MySQL, PostgreSQL and Java DB colleagues, as well as to many other colleagues involved in open-source development, for having

  [Read more...]
Golden Rules for Contribution-based Communities
Employee +0 Vote Up -0Vote Down

There are some basic, golden rules when it comes to having a vibrant community of contributors.

The following are rules I have extracted and learned based on my experience managing and working with engineers actively involved and participating in the Apache/Derby, PostgreSQL and MySQL open-source communities. These rules are also based on extensive discussions with many folks involved with the MySQL community, with the PostgreSQL community and with the Apache/Derby (Java DB) community, over many years.

Before I go through these rules, I would like to thank Marten Mickos for having suggested some of the headings for these rules. (I originally had much longer headings for all of them.) I would also like to thank many of MySQL, PostgreSQL and Java DB colleagues, as well as to many other colleagues involved in open-source development, for having

  [Read more...]
Upload Image to MySQL using PHP
+0 Vote Up -0Vote Down
Upload Image to MySQL using PHP As a new-bie to php/mysql, I tried different stuffs. So here I’m with my php code for Image Upload to MySQL. Its a quite...
Progress in nofrm branch
+0 Vote Up -0Vote Down

“Ban FRM Now!” branch in Launchpad

Now we’re reading part of the table information out of the proto file on disk instead of the frm.

Not everything (yet) but a bit. Good first steps. Had to fix bugs along the way as well (and find weirdness in FRM file format…).

Progress is being made.

Source Control Layouts for Databases
+0 Vote Up -0Vote Down
It’s easy to decide that you’re going to store changes to your database in source control, but it can be difficult to figure out what and where it should be stored.  In this article I’ll explain what I like to see put into source control, and how I layout my source control folders. There are […]
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...
Performance notes on INFORMATION_SCHEMA tables
+0 Vote Up -0Vote Down
I have written a bit in the past about using INFORMATION_SCHEMA tables, and I use them extensively in stored procedures for performing regular maintenance operations. There are a great many clever and useful things you can do with them. However, recently I have been noticing some performance issues using these tables that puts a damper […]
Interesting SQL Challenge
+0 Vote Up -0Vote Down
A former colleague recently posed a problem to me: “This guy has a table full of table names, and he wants to run a query that unions those tables.” I spent a couple of minutes telling him why it was a bad idea. It’s not a very robust solution, and an incorrect value in your […]
libmallocfail
+0 Vote Up -0Vote Down

Bazaar branches of libmallocfail

Simple LD_PRELOAD library that will take parameters via environment variables and cause malloc() to occationally fail.

Aim was to use this to test bits of MySQL/Drizzle although since their libtool based stuf, the binary in tree is a libtool shell script, and I haven’t found a way to LD_PRELOAD only for mysqld and not the shell script and the other processes spawned by it.

I have found a bug in libc though :)

Using short if statement in programming
+0 Vote Up -0Vote Down

In many programing languages it is possible to shorten if statements using what’s called the ternary operator. It is sometimes referred as the “one line if statement” or the “short if statement”. This can help at times to produce cleaner code, however use this operator wisely as it is not always best to be used for more complicated statements.

PHP Example of an if statement


1
2
3
4
5
6
7
8
if($nFoo > 0)
{
   echo "I'm at the work.";
}
else
{
   echo "I'm at home.";
}

PHP Example using the ternary operator


1
echo $nFoo > 0 ? "I'm at the work." : "I'm at home.";

The expression (expr1) ? (expr2) : (expr3) evaluates to expr2 if

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

Sun is a huge company. So it comes as no surprise that I’m finding out about Project Kenai via Tim Bray, instead of some internal mailing list (believe me, there must be thousands).

Tim’s got a Q&A with Nick Sieger, who’s one of the chieftains behind Kenai. I find it amusing that the comparison is made against Google Code and GitHub - has SourceForge hit irrelevancy? I’m surprised Launchpad isn’t mentioned.


Very Cover Flow like UI, with slider, etc. That’s Elliot Murphy, ex-Dolphin, current Ubuntero in the pic

  [Read more...]
how to fix eleven bugs in mysql 5.1
+0 Vote Up -0Vote Down
my “mysql client fixes” branch on launchpad contains fixes for eleven bugs (nine of them reported on bugs.mysql.com).

don’t get too excited — these are all the lowest priority-level bugs, mostly typos in comments and documentation.

now i have to figure out the latest process for actually getting these changes into the official tree. there are different policies around how and when to push to trees since i was last doing any server development. from someone who is partially outside, it all seems very tedious and designed to make it impossible to fix anything. process gone bad.

the mysql server isn’t going to get the benefits of using a good, open-source distributed revision control system unless it stops
Creating an Intermediate Replication Layer
+0 Vote Up -0Vote Down
A few weeks ago, I discussed how to keep binlogs in sync in a tree or pyramid replication scheme. That thread discussed how to re-distribute load in case of failure in one of the intermediate slaves. Today we will look at how to create those intermediate replication slaves. We start with a traditional flat replication […]
Most Commonly Sought-After Command in MySQL Proxy
+0 Vote Up -0Vote Down

One of the most frequently needed functionality in the MySQL Proxy is the need to know which server you are on. This is not given, on purpose, by the proxy, because the proxy is supposed to be transparent. It is not supposed to matter which back-end server you are on.

However, for testing purposes we often want to know which back-end server we’re on. Thus I developed functionality for SHOW PROXY BACKEND [INDEX ADDRESS OTHER].

SHOW PROXY BACKEND INDEX — gives the index of the server you’re on (backend_ndx, ie 1)

SHOW PROXY BACKEND ADDRESS — gives the address of the server you’re on (ie, foo.bar.com:3306)

SHOW PROXY BACKEND OTHER — gives the address of all the other servers except those you’re not on, in multiline format.

Note that I was

  [Read more...]
Introducing wordpress-scripts 0.1 (0.2 out)
+0 Vote Up -0Vote Down

Update: I’ve been suffering some ungly and stupid bugs today, so I’ve fixed them and released version 0.2. It also includes a new script wp-update-home.


I’ve just published some scripts that help me manage my personal wordpress installations, and publish some plugins I’m working on.

Warning: these are early versions which I use for small tasks. If you find
a bug or have suggestions, contact me at jbernal@warp.es

Download version 0.1



  [Read more...]
bug tracking and code review
+0 Vote Up -0Vote Down
i was going to write some reactions to an observation that postgresql has no bug tracker and its discussion last week, but lost the spark and abandoned the post after a few days. but today i ran across a quote from linus torvalds that neatly sums up my thoughts:

We’ve always had some pending/unresolved issues, and I think that as our tracking gets better, there’s likely to be more of them. A number of bug-reports are either hard to reproduce (often including from the reporter) or end up without updates etc.


before there was a bug tracking system for mysql, there was a claim that all bugs were fixed in each release (or documented), and there has been a lot of pain in seeing



  [Read more...]
Using information_schema to write code for you
+0 Vote Up -0Vote Down
Back when I was doing a lot of work with Oracle, I learned to lean heavily on the SYSTEM views - Oracle’s equivalent to the INFORMATION_SCHEMA database. These views can really help you when it comes to writing dynamic SQL in stored procedures, or just taking quick shortcuts while you’re writing code. Or, if you’re [...]
don’t ask too many questions
+0 Vote Up -0Vote Down
chyrp is a nice looking piece of blog software. individual posts can have different styles, something it borrowed from the hosted tumblr service. i was interested to read about “the sql query massacre of january 19th, 2008” but the numbers gave me pause — 21 queries to generate the index page? that is down from an astounding 116, but that still seems ridiculous to me.

the number of queries to generate the index of this site? two. one of them is SET NAMES utf8. i could see boosting that to three or four if i moved some things like the list of links in the sidebar into the database, or added archive links. call it five if i had user accounts.

but right now, the number of queries used to load the index



  [Read more...]
what is 10% of php worth?
+0 Vote Up -0Vote Down
i am listed as one of the ten members of the php group. most of the php source code says it is copyright “the php group” (except for the zend engine stuff). the much-debated contributor license agreement for PDO2 involves the php group.

could i assign whatever rights (and responsibilities) my membership in the php group represents to someone else? how much should i try to get for it? i mean, if mysql was worth $1 billion....

i am still disappointed that a way of evolving the membership of the php group was never established.
From development to production and back in a blink
+0 Vote Up -0Vote Down

If you do serious web development, you sure have multiple working environments. This is true for ruby on rails, but I’ll guess you’ll do the same using other frameworks or languages. I’ve found a quite useful Firefox extension to switch from development to production (and back) with just a click (or a keystroke: Ctrl-Shift-X): Server Switcher

This is helping me redesigning the MySQL training part of our website, and can be useful in some other situations.

PHP Free Chat - Joining Chat Email Notification
+0 Vote Up -0Vote Down

I recently upgraded an install of PHP Free Chat to that latest version of 1.0 Final. However it was still lacking a feature to notify individual(s) that someone has joined the chat if they were not already in the chat application to begin with. I came across a posting explaining how to achieve this in PHP Free Chat at PHP Free Chat Forum. After a little reading and discussion I was able to implement the feature.

Here’s my modified version for the solution based on the forum posting. The pfcmail() function can be made to be way more versatile for any use, however for my use it was made to be simple and produce properly formated email messages.

Solution


  • Create a new PHP file called pfcmail.php with the following
  •   [Read more...]
    Read Buffer performance hit
    +0 Vote Up -0Vote Down

    I had some fun yesterday with some odd performance problems. So I did a run with oprofile and got this:

    561612   25.0417  /lib64/tls/libc-2.3.4.so memset
    429457   19.1491  /usr/lib/debug/lib/modules/2.6.9-34.ELsmp/vmlinux clear_page
    214268    9.5540  /usr/lib/debug/lib/modules/2.6.9-34.ELsmp/vmlinux do_page_fault
    144293    6.4339  /usr/lib/debug/lib/modules/2.6.9-34.ELsmp/vmlinux do_no_page
    94410     4.2097  /usr/lib/debug/lib/modules/2.6.9-34.ELsmp/vmlinux buffered_rmqueue
    64998     2.8982  /lib64/tls/libc-2.3.4.so memcpy
    59565     2.6559  /usr/lib/debug/lib/modules/2.6.9-34.ELsmp/vmlinux __down_read_trylock
    59369     2.6472 

      [Read more...]
    Slides for The Age of Literate Machines
    +0 Vote Up -0Vote Down

    I’ve just posted slides and (rather) rough presenter notes and image credits for my Age of Literate Machines presentation.

    These are still draft slides. I’ll be working on an improved version in the coming weeks and months.

    Many thanks to all who have sat through drafts of the talk (DES, Jen, Hilde, Markus, Monty, Rory, Tony).

      [Read more...]
    Loading a MySQL database in memory (with some Ruby help)
    +0 Vote Up -0Vote Down

    Let’s say when you have to run a batch process monthly, you can survive with times like 10 minutes. I can imagine a lot of seasoned DBAs right now ROFL about my insignificant 10 minutes. The point here is I was developing this process and some test cases, so my usual trial/error methodology doesn’t scale very well with 10 minute offsets.

    So I borrowed an idea from a colleague: why not moving all the database to memory? It’s not so big and I have 2G of ram. But, could I change all tables (~20) to MEMORY in one line or so?

    Since this was a Ruby on Rails project, I used the rails console to be able to mix SQL and Ruby. My first try:

    conn.tables.each do |t|
      conn.execute "ALTER TABLE #{t} ENGINE=MEMORY"
    end

      [Read more...]
    Hacking MySQL: making TRUNCATE behaviour more intuitive
    +0 Vote Up -0Vote Down

    This is my second article about hacking MySQL. If you are interested in this topic, you may want to read my previous Hacking MySQL: SIGNAL support (I)

    The problem

    If I tell you there is a function called TRUNCATE, what do you think it does? which are its arguments?

    For me, the obvious behaviour would be something like:

    mysql> SELECT TRUNCATE(123.45);
    +--------------------+
    | TRUNCATE(123.45)   |
    +--------------------+
    |                123 |
    +--------------------+
    1 row in set (0.08 sec)

    But the actual behaviour is this:

    mysql> SELECT TRUNCATE(123.45);
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to

      [Read more...]
    Previous 30 Newer Entries Showing entries 121 to 150 of 150

    Planet MySQL © 1995, 2013, 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.