Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30336 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43138 invoked by uid 1010); 26 Jun 2007 02:03:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 43106 invoked from network); 26 Jun 2007 02:03:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2007 02:03:15 -0000 Authentication-Results: pb1.pair.com header.from=ilia@prohost.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ilia@prohost.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain prohost.org from 64.233.166.176 cause and error) X-PHP-List-Original-Sender: ilia@prohost.org X-Host-Fingerprint: 64.233.166.176 py-out-1112.google.com Received: from [64.233.166.176] ([64.233.166.176:43065] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/13-01436-FD370864 for ; Mon, 25 Jun 2007 22:03:13 -0400 Received: by py-out-1112.google.com with SMTP id f31so527347pyh for ; Mon, 25 Jun 2007 19:03:06 -0700 (PDT) Received: by 10.64.233.12 with SMTP id f12mr10298181qbh.1182823385527; Mon, 25 Jun 2007 19:03:05 -0700 (PDT) Received: from ?192.168.1.110? ( [99.246.70.178]) by mx.google.com with ESMTP id e14sm5319073qba.2007.06.25.19.03.04 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2007 19:03:05 -0700 (PDT) In-Reply-To: <20070626114940.2b6c51a0.kevin@oceania.net> References: <20070626114940.2b6c51a0.kevin@oceania.net> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <5C2931F8-43FF-4E1F-9430-320B34C426AF@prohost.org> Cc: internals@lists.php.net, wez@php.net Content-Transfer-Encoding: 7bit Date: Mon, 25 Jun 2007 22:03:02 -0400 To: Kevin Waterson X-Mailer: Apple Mail (2.752.3) Subject: Re: [PHP-DEV] pdo_mysql patch From: ilia@prohost.org (Ilia Alshanetsky) Will this mechanism for differentiating between TEXT and BLOB work in MySQL 3.23? On 25-Jun-07, at 9:49 PM, Kevin Waterson wrote: > currently pdo_mysql is unable to discern between a BLOB and a TEXT > field > in mysql_statement.c > By using the current if (IS_BLOB(F->flags)), which is now > deprecated in > the mysql c api, it will be true for both TEXT and BLOB fields. > > By updating a little to the newer api and checking with F->type we get > the same result, however, further checking on the character set number > can distinguish between BINARY and CHAR, VARBINARY and VARCHAR, and > BLOB > and TEXT fields. > > When using PDOStatement::getColumnMeta() any field with charsetnr > of 63 > reports as text, rather than blob. Patch follows... > > --- old.c 2007-06-26 11:27:57.000000000 +1000 > +++ mysql_statement.c 2007-06-26 11:26:47.000000000 +1000 > @@ -581,8 +581,12 @@ > if (F->flags & UNIQUE_KEY_FLAG) { > add_next_index_string(flags, "unique_key", 1); > } > - if (IS_BLOB(F->flags)) { > - add_next_index_string(flags, "blob", 1); > + if(F->type == MYSQL_TYPE_BLOB) { > + if(F->charsetnr == 63) { > + add_next_index_string(flags, "blob", 1); > + } else { > + add_next_index_string(flags, "text", 1); > + } > } > str = type_to_name_native(F->type); > if (str) { > > > > > -- > "Democracy is two wolves and a lamb voting on what to have for lunch. > Liberty is a well-armed lamb contesting the vote." > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Ilia Alshanetsky