[Maria-developers] MYSQL_TYPE_DECIMAL type
![](https://secure.gravatar.com/avatar/bda86bcbef84c75ba6fdb3d7e744693b.jpg?s=120&d=mm&r=g)
Hello all, Under what circumstances can a table be created with MYSQL_TYPE_DECIMAL as being one of the columns? I thought MYSQL_TYPE_DECIMAL was deprecated pre 5.1. I thought all new tables use MYSQL_TYPE_NEWDECIMAL. We have a user reporting a table he wants to alter has that type. However, when I create that table, I don't get that type. As an aside, we don't support that type, mainly because I thought it was impossible to have a table created with it (I am apparently wrong). Is there a way to ensure that tables undergoing an alter convert that column to MYSQL_TYPE_NEWDECIMAL? Thanks -Zardosht
![](https://secure.gravatar.com/avatar/3c2329333dd5898f2e72818af773243d.jpg?s=120&d=mm&r=g)
Hi, Zardosht! On Apr 26, Zardosht Kasheff wrote:
Hello all,
Under what circumstances can a table be created with MYSQL_TYPE_DECIMAL as being one of the columns? I thought MYSQL_TYPE_DECIMAL was deprecated pre 5.1. I thought all new tables use MYSQL_TYPE_NEWDECIMAL.
I've quickly checked the code and couldn't find a way to create a table with the MYSQL_TYPE_DECIMAL column. There are even asserts in the code that show it's impossible. So, I'm very interested to know how your customer managed to do it :) Please share it, if you'll find it out.
Is there a way to ensure that tables undergoing an alter convert that column to MYSQL_TYPE_NEWDECIMAL?
It's pretty difficult to test, if there's no way to create a table with MYSQL_TYPE_DECIMAL in the first place. Regards, Sergei
![](https://secure.gravatar.com/avatar/bda86bcbef84c75ba6fdb3d7e744693b.jpg?s=120&d=mm&r=g)
I think they had a 5.0 table with the old type, upgraded their system
to the new binaries, then did an alter table. Apparently, the alter
table preserves the old type, and does not create a table with the new
type
On Wed, May 8, 2013 at 5:44 AM, Sergei Golubchik
Hi, Zardosht!
On Apr 26, Zardosht Kasheff wrote:
Hello all,
Under what circumstances can a table be created with MYSQL_TYPE_DECIMAL as being one of the columns? I thought MYSQL_TYPE_DECIMAL was deprecated pre 5.1. I thought all new tables use MYSQL_TYPE_NEWDECIMAL.
I've quickly checked the code and couldn't find a way to create a table with the MYSQL_TYPE_DECIMAL column. There are even asserts in the code that show it's impossible.
So, I'm very interested to know how your customer managed to do it :) Please share it, if you'll find it out.
Is there a way to ensure that tables undergoing an alter convert that column to MYSQL_TYPE_NEWDECIMAL?
It's pretty difficult to test, if there's no way to create a table with MYSQL_TYPE_DECIMAL in the first place.
Regards, Sergei
![](https://secure.gravatar.com/avatar/f8dadb41fe4fb69f346c61d4c352f0ab.jpg?s=120&d=mm&r=g)
On 08.05.2013 11:44, Sergei Golubchik wrote:
I've quickly checked the code and couldn't find a way to create a table with the MYSQL_TYPE_DECIMAL column. There are even asserts in the code that show it's impossible.
So, I'm very interested to know how your customer managed to do it :) Please share it, if you'll find it out.
pre-5.0 tables can stay around with the older types as this case is not
detected or handled by mysql_upgrade, see:
http://bugs.mysql.com/bug.php?id=57171
and also the related
http://bugs.mysql.com/bug.php?id=57166
http://bugs.mysql.com/bug.php?id=57426
--
Hartmut Holzgraefe
participants (3)
-
Hartmut Holzgraefe
-
Sergei Golubchik
-
Zardosht Kasheff