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

Displaying posts with tag: tinyint (reset)

MySQL 101 : Numeric type attributes and maximum value
+4 Vote Up -1Vote Down

I would like to make a quick MySQL 101 about numeric types in MySQL and especially explain the difference between the numeric type attributes and the maximum value that a numeric type can store.

Someone asked me yesterday why when he inserts a value in a table, the value 127 appears instead of the value 160 that he’s just inserted.
Ok, let me explain, consider this table :

What happens if you want to insert this row in the table :

sql > insert into product values (160, 554, "iPad mini");
Query OK, 1 row affected, 1 warning …

  [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 …




  [Read more...]
pack_flag is dead!
+0 Vote Up -0Vote Down

(At least in Drizzle)

Brian merged my jay-and-stewart-remove-pack_flag branch and it’s now in trunk. Removing pack_flag was a task for the bell milestone and in true collaborative effort, it took more than one person to unravel its dark mysteries. Hats go off to Jay who bravely ripped more of it out with the aid of excellent Seattle coffee. I finished it off with removing the last remnants and fixing …

  [Read more...]
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.