Skip Menu |
 

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 118977
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: MICHIELB [...] cpan.org
Requestors: knarf [...] knarf.de
Cc: pali [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
Dkim-Filter: OpenDKIM Filter v2.10.3 mail.server-king.de uAQG8QaH004312
X-Authentication-Warning: cheese.server-king.de: knarf set sender to knarf [...] knarf.de using -f
X-Spam-Status: No, score=-2.001 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_PASS=-0.001] autolearn=ham
Content-Disposition: inline
X-Spam-Flag: NO
X-Virus-Checked: Checked
Content-Type: multipart/signed; boundary="vtzGhvizbBRQ85DL"; micalg="sha-256"; protocol="application/x-pkcs7-signature"
Message-ID: <20161126160826.GA514 [...] server-king.de>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -2.001
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D309524028E for <cpan-bug+DBD-mysql [...] hipster.bestpractical.com>; Sat, 26 Nov 2016 11:08:44 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D9w-TVqEAWdh for <cpan-bug+DBD-mysql [...] hipster.bestpractical.com>; Sat, 26 Nov 2016 11:08:43 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id D13F12401D6 for <bug-DBD-mysql [...] rt.cpan.org>; Sat, 26 Nov 2016 11:08:42 -0500 (EST)
Received: (qmail 3604 invoked by alias); 26 Nov 2016 16:08:41 -0000
Received: from mail.server-king.de (HELO mail.server-king.de) (148.251.157.91) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sat, 26 Nov 2016 08:08:33 -0800
Received: from mail.server-king.de (mail.server-king.de [148.251.157.91]) by mail.server-king.de (8.15.2/8.15.2) with ESMTPS id uAQG8QaH004312 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <bug-DBD-mysql [...] rt.cpan.org>; Sat, 26 Nov 2016 17:08:26 +0100 (CET) (envelope-from knarf [...] knarf.de)
Received: (from knarf [...] localhost) by mail.server-king.de (8.15.2/8.15.2/Submit) id uAQG8Qe8004311 for bug-DBD-mysql [...] rt.cpan.org; Sat, 26 Nov 2016 17:08:26 +0100 (CET) (envelope-from knarf [...] knarf.de)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] knarf.de
Delivered-To: cpan-bug+DBD-mysql [...] hipster.bestpractical.com
User-Agent: Mutt/1.7.1 (2016-10-04)
Subject: zerofill
Return-Path: <knarf [...] knarf.de>
X-RT-Mail-Extension: dbd-mysql
X-Original-To: cpan-bug+DBD-mysql [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=simple/simple; d=knarf.de; s=mail.server-king.de; t=1480176506; bh=Wea9vvA9VnmN3SBaR7u1pnCKW5MLRyCAw8OW4s0c4qg=; h=Date:From:To:Subject; b=KetunciOSxrSWxezG6qVqYKCt/KEfWPhV3Q6o99xTF4COphL47B0MK7PkUeBFxRUa tNv4Sb1loEFZew0Y2ggfivNfit2IFkhhyYZTWnL9gNf/joPzwA7KYI+WNer0ywhg6U beYutXrQwjxmv4lrKZsnQsSiK3KriOdS3WtjsCVw=
Date: Sat, 26 Nov 2016 17:08:26 +0100
X-Spam-Level:
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.1 (mail.server-king.de [148.251.157.89]); Sat, 26 Nov 2016 17:08:26 +0100 (CET)
To: bug-DBD-mysql [...] rt.cpan.org
From: Frank Bartels <knarf [...] knarf.de>
X-RT-Interface: Email
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Disposition: inline
X-RT-Original-Encoding: iso-8859-15
Content-Length: 1018
Download (untitled) / with headers
text/plain 1018b
Hi, I use perl v5.24.1 together with p5-DBD-mysql-4.040. I have a script that used to work for 10 years or more but now broke because of the recent changes: "Fix integer types when server side prepare statements are enabled" I do something like this: my $query = $dbh->prepare("SELECT Albums.Id,Tracks.Id,Albums.Artist,Albums.Title,Albums.Cddb,Albums.Genre,Albums.Year,Tracks.Trackname,Tracks.Tracknum,Tracks.Length,Tracks.VBR,Tracks.Bitrate FROM Tracks,Albums WHERE Tracks.Albumref=Albums.Id ORDER BY Tracks.Id"); $query->execute; while ( ( $AlbumId, $TrackId, $DB{TPE1}, $DB{TALB}, $DB{CDDB}, $DB{TCON}, $DB{TYER}, $DB{TIT2}, $DB{TRCK}, $DB{TLEN}, $DB{VBR}, $DB{BITRATE} ) = $query->fetchrow_array ) { Albums.Id is "smallint(5) unsigned zerofill" in mysql 5.5.53. Before 4.040 $AlbumId was "00001". With 4.040 $AlbumId changed to "1". I know this is not the best design. :) I fixed it doing $AlbumId = sprintf("%05s", $AlbumId); for now. Do you plan to bring back the old behaviour? Thanks, Knarf
Content-Type: application/x-pkcs7-signature
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64
Content-Length: 3987
Download smime.p7s
application/x-pkcs7-signature 3.8k

Message body not shown because it is not plain text.

MIME-Version: 1.0
In-Reply-To: <20161126160826.GA514 [...] server-king.de>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <20161126160826.GA514 [...] server-king.de>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-25644-1480455308-472.118977-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1620
Download (untitled) / with headers
text/plain 1.5k
On Sob Nov 26 11:08:46 2016, knarf@knarf.de wrote: Show quoted text
> Hi, > > I use perl v5.24.1 together with p5-DBD-mysql-4.040. > > I have a script that used to work for 10 years or more but now broke > because of the recent changes: "Fix integer types when server side > prepare statements are enabled" > > I do something like this: > > my $query = $dbh->prepare("SELECT > Albums.Id,Tracks.Id,Albums.Artist,Albums.Title,Albums.Cddb,Albums.Genre,Albums.Year,Tracks.Trackname,Tracks.Tracknum,Tracks.Length,Tracks.VBR,Tracks.Bitrate > FROM Tracks,Albums WHERE Tracks.Albumref=Albums.Id ORDER BY > Tracks.Id"); > $query->execute; > > while ( ( $AlbumId, $TrackId, $DB{TPE1}, $DB{TALB}, $DB{CDDB}, > $DB{TCON}, > $DB{TYER}, $DB{TIT2}, $DB{TRCK}, $DB{TLEN}, $DB{VBR}, $DB{BITRATE} > ) = $query->fetchrow_array ) { > > Albums.Id is "smallint(5) unsigned zerofill" in mysql 5.5.53. > > Before 4.040 $AlbumId was "00001". With 4.040 $AlbumId changed to > "1". > > I know this is not the best design. :) > > I fixed it doing > > $AlbumId = sprintf("%05s", $AlbumId); > > for now. > > Do you plan to bring back the old behaviour? > > Thanks, > Knarf
Hi! ZEROFILL mysql attribute is not supported by DBD::mysql yet. You had just luck that if worked and probably worked only for non-server-side prepared statements. Anyway, for supporting ZEROFILL in DBD::mysql I see there only one solution: Tell mysql to return column as string, not integer. That can be quite ineffective, but probably only possible solution right now... Here is patch for it: https://github.com/perl5-dbi/DBD-mysql/pull/75 I would be happy if you test it.
MIME-Version: 1.0
In-Reply-To: <20161126160826.GA514 [...] server-king.de>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <20161126160826.GA514 [...] server-king.de>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-14624-1480580522-121.118977-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
RT-Send-CC: pali [...] cpan.org
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 180
Download (untitled) / with headers
text/plain 180b
This is now merged in https://github.com/perl5-dbi/DBD-mysql/commit/dc4d40b1df2f05b9e23105ab6d7b98c77eb318de Thanks Pali for the patch, and thanks Knarf for the report! -- Michiel
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-14624-1480580522-121.118977-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <20161126160826.GA514 [...] server-king.de> <rt-4.0.18-14624-1480580522-121.118977-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-6999-1498900911-1861.118977-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 37
Reopening, fix was reverted in 4.043.
MIME-Version: 1.0
In-Reply-To: <20161126160826.GA514 [...] server-king.de>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <20161126160826.GA514 [...] server-king.de>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-23368-1510644233-1559.118977-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 113
Download (untitled) / with headers
text/plain 113b


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.