MySQL 5.0 supports a range of features that earlier versions of MySQL do not support. This article, the fourth in a series, explains views and other new features. It is excerpted from chapter eight of Beginning MySQL Database Design and Optimization: From Novice to Professional, written by Jon Stephens and Chad Russell (Apress, ISBN: 1590593324).
Beginning in MySQL 5.0.0, user variable names are case insensitive. This means that @myvar , @MyVar , and @MYVAR will all be regarded as the same variable, as shown here (using MySQL 5.0.1-alpha):
If you’ve been relying on case sensitivity in user variables for any of your MySQL-related work, we recommend highly that you abandon this practice immediately.
New Values for DATE_ADD() and DATE_SUB() Functions
Two new values, WEEK and QUARTER , have been added for use with the DATE_ADD() and DATE_SUB() functions in MySQL 5.0. You can see how these are used and what sorts of results you can expect from them here:
Change in the VARCHAR Type
The VARCHAR type is expected to be altered so that it will be possible to store values with more than 255 characters. That hasn’t happened yet as of MySQL 5.0.1—if you attempt to define a VARCHAR column with a size of greater than 255 characters, MySQL will simply convert the column to the TEXT datatype. (See Chapter 2 of this book for a discussion of how MySQL “silently” changes column types.) However, we look for a change to take place by the time that MySQL 5.0 appears in a production release.