Re: Forwarded: another bug in Connector/J 3.0.6 ?

Re: Forwarded: another bug in Connector/J 3.0.6 ?

am 04.04.2003 14:31:24 von Mark Matthews

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

| Adrián Benko
| Date:
| Thu, 3 Apr 2003 18:22:14 +0200
| To:
|
|
| Hi,
|
| Sorry to distrub you, but I have one problem with Connector or something
| else.
|
| I have table "AVALUES" with two columns:
| 1. VALUES_STRING ... varchar(50)
| 2. VALUES_DATE .... datetime
|
| VALUES_STRING VALUES_DATE
| 1.1.2002 null
| 2.2.2002 null
|
|
| if I try statement:
| update AVALUES set VALUES_DATE = convert(VALUES_STRING,datetime) or
| update AVALUES set VALUES_DATE = cast(VALUES_STRING as datetime)
|
| if some GUI for MySQL (I use SQLyog) it works
| if I run it from JAVA program with Connector to MySQL it executes without
| error but no change in database
|
| stmt.executeUpdate("update AVALUES set VALUES_DATE =
| convert(VALUES_STRING,datetime) ");
|
| is it my fault ?
|
| Adrian



I can't duplicate this issue:



| Statement stmt = conn.createStatement();
|
| stmt.executeUpdate("DROP TABLE IF EXISTS castTest");
| stmt.executeUpdate("CREATE TABLE castTest(VALUES_STRING
varchar(50), VALUES_DATE datetime)");
| stmt.executeUpdate("INSERT INTO castTest (VALUES_STRING,
VALUES_DATE) VALUES ('1.1.2002', null), ('2.2.2002', null)");
|
| ResultSet rs = stmt.executeQuery("SELECT * FROM castTest");
|
| System.out.println("VALUES IN TABLE:");
|
| while (rs.next()) {
| System.out.println(rs.getString(1) + ", " + rs.getString(2));
| }
|
| System.out.println("Executing update...");
| stmt.executeUpdate("update castTest set VALUES_DATE =
convert(VALUES_STRING,datetime) ");
|
| rs = stmt.executeQuery("SELECT * FROM castTest");
|
| System.out.println("VALUES IN TABLE:");
|
| while (rs.next()) {
| System.out.println(rs.getString(1) + ", " + rs.getString(2));
| }


Results:

| VALUES IN TABLE:
| 1.1.2002, null
| 2.2.2002, null
| Executing update...
| VALUES IN TABLE:
| 1.1.2002, 2001-01-20 02:00:00
| 2.2.2002, 2002-02-20 02:00:00

- --
MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

~ __ ___ ___ ____ __
~ / |/ /_ __/ __/ __ \/ / Mark Matthews
~ / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
~ /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
~ <___/ www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+jXsctvXNTca6JD8RAqliAJ9Sscv2Hh/5vUpiIG1eHyou45w63gCg tnf/
qu72ebj3wzbgK31hxGYk2WI=
=jXk1
-----END PGP SIGNATURE-----


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org