Bug #26130 support CAST(column AS BIGINT)

Submitted: 6 Feb 2007 23:56 Modified: 16 Jan 2009 15:59
Reporter: Dan Karp Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Data Types Severity:S4 (Feature request)
Version:5.0.27, 5.1 OS:Any
Assigned to: CPU Architecture:Any

[6 Feb 2007 23:56] Dan Karp
Description:
From looking at the SQL spec, it should be possible to do a CAST(column AS BIGINT).  MySQL returns a syntax error on such queries, however.

For SQL portability, how about supporting more target types for the CAST operator?

How to repeat:
CREATE TABLE items (
   id    INTEGER UNSIGNED NOT NULL,
   size  INTEGER UNSIGNED NOT NULL
) ENGINE = InnoDB;

INSERT INTO items VALUES (1, 20000);
INSERT INTO items VALUES (2, 55000);

SELECT SUM(CAST(size AS BIGINT)) FROM items;
[16 Jan 2009 15:59] Susanne Ebrecht
Many thanks for writing a feature request. Verified as described.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
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.