Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 3

Displaying posts with tag: datatypes (reset)

Upgrading old MySQL-5.5 format temporals to MySQL-5.6 format.
Employee_Team +1 Vote Up -0Vote Down

The temporal datatypes ‘TIME/DATETIME/TIMESTAMP’ supports fractional values starting from MySQL 5.6.4 version. Hence the storage requirement and encoding differs in comparison to pre- MySQL 5.6.4 temporal datatypes.

As mentioned in the section ‘Upgrading from MySQL 5.5 to 5.6′,

http://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.html

Once you have imported the pre-MySQL 5.6.4 tables, ‘ALTER TABLE’ allows creation of tables containing temporal columns of both mysql-5.5 and mysql-5.6 format.

As noted in the documentation, the disadvantages of having such tables are:

  • Recreating tables having both 5.5 and 5.6 temporals becomes tedious process when the metadata file(.frm) for the table is unavailable. This would involve recreating the table having the old temporal
  [Read more...]
Are bools bools in MySQL?
+0 Vote Up -0Vote Down

Are bools bools in MySQL - no they're not! Lets show this:


mysql> CREATE TABLE healthcheck ( isworking bool ) ENGINE=MEMORY;Query OK, 0 rows affected (0.14 sec)



mysql> show create table healthcheck\G

*************************** 1. row ***************************

Table: healthcheck

Create Table: CREATE TABLE `healthcheck` (

`isworking` tinyint(1) DEFAULT NULL

) ENGINE=MEMORY DEFAULT CHARSET=latin1

1 row in set (0.00 sec)

So a 'bool' in MySQL is actually a signed tinyint that has range -128 to 127. This information is actually hidden away in the bowels of the MySQL documentation at:http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html"[bool] These types are synonyms for


  [Read more...]
Making use of procedure analyse()
+1 Vote Up -0Vote Down
SELECT Field0[,Field1,Field2,...] FROM TABLE PROCEDURE ANALYSE() is a nice tool to find out more about your table’s columns. Still, it could be improved in a lot of ways, and the stored procedure below is a starting point. It makes use of procedure analyse (though with ‘SELECT * FROM’), and modifies it’s output to include the […] No related posts.
Showing entries 1 to 3

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

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.