I am using 4.1.0 and 4.1.1 on Windows
On WinXP, it even crashes the server when I add extra date fields.
On Win2k AS, it doesn't crash the MySQL server but it returns unexpected
results.


Thanks
Emery
----- Original Message -----
From: "Victoria Reznichenko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 12:36
Subject: Re: Problem with LPAD() function


> "Director General: NEFACOMP" <[EMAIL PROTECTED]> wrote:
>
> > I think there is a bug in LPAD() function.
> >
> > Just try to run this query:
> >     SELECT LPAD(12, 3, '0');
> >         This will correctly return 012 as expected.
> >
> > But when I run
> >     SELECT LPAD(512, 3, '0');
> >         It doesn't return 512, instead it returns special characters.
> >
> > With that situation I tried the following
> >     SELECT LPAD('512', 3, '0');
> >         And it worked as required.
> >
> > So, my conclusion will be that the type conversion will only take place
when the number of characters to PAD is bigger than the length of the
original string.
>
> What version do you use?
> Works like a charm for me:
>
> mysql> SELECT LPAD(12, 3, '0');
> +------------------+
> | LPAD(12, 3, '0') |
> +------------------+
> | 012              |
> +------------------+
> 1 row in set (0.00 sec)
>
> mysql> SELECT LPAD(512, 3, '0');
> +-------------------+
> | LPAD(512, 3, '0') |
> +-------------------+
> | 512               |
> +-------------------+
> 1 row in set (0.00 sec)
>
>
> --
> For technical support contracts, goto https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.net http://www.ensita.net/
>    __  ___     ___ ____  __
>   /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
>  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
>        <___/   www.mysql.com
>
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>
>
>



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to