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.