Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6144935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:43:21+00:00 2026-05-23T18:43:21+00:00

I have the member table which has 9 fields: id,email,… so on. member_type is

  • 0

I have the member table which has 9 fields: id,email,… so on.

member_type is the 8th field

The 8th field is always converted to decimal, no matter what name it is or what type it is.

Here is some experimenting I have done:

irb(main):010:0> Member.all()[0].attributes

=> {"created_date"=>nil, "email"=>"tanixxx@yahoo.com", "id"=>1, "is_admin"=>0, "
member_type"=>#<BigDecimal:4f87ce0,'0.0',4(8)>, "name"=>"tanin", "password"=>"3c
f622832f10a313cb74a59e6032f115", "profile_picture_path"=>"aaaaa", "status"=>"APP
ROVED"}

Please notice :member_type, which is the 8th field.

Now if I query only some fields, the result is correct:

irb(main):007:0> Member.all(:select=>"member_type,email")[0].attributes

=> {"email"=>"tanixxx@yahoo.com", "member_type"=>"GENERAL"}

I think there must be a bug in ActiveRecord.


Here is some more experiment. I have added “test_8th_field” to be the 8th field and I got this:

irb(main):016:0> Member.all[0].attributes

=> {"created_date"=>nil, "email"=>"tanixxx@yahoo.com", "id"=>1, "is_admin"=>0, "
member_type"=>"GENERAL", "name"=>"tanin", "password"=>"3cf622832f10a313cb74a59e6
032f115", "profile_picture_path"=>"aaaaa", "status"=>"APPROVED", "test_8th_field
"=>#<BigDecimal:30c87f0,'0.0',4(8)>}

The 8th field is a BigDecimal (it is a text field in MySQL, though). But the member_type field is amazingly correct this time.

I don’t know what is wrong with the number 8…

Please help me.


Here is my schema dump, including test_8th_field:

CREATE TABLE IF NOT EXISTS `members` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `profile_picture_path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `is_admin` int(11) NOT NULL,
  `test_8th_field` text COLLATE utf8_unicode_ci NOT NULL,
  `member_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'GENERAL',
  `created_date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:43:22+00:00Added an answer on May 23, 2026 at 6:43 pm

    I have solved it. It turns out that the MySql binary library does not match the version for the MySql database itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which has field with data type as DATETIME. I persist
Hay, I have a table a products which has a 'cost_price' field. When a
I have a table which has a foreign key referencing itself. This would be
I have a Member Table with fields MemID - Primary Key Business_Name Business_Address Business_Phone
I have two databases($db1, $db2) with exact table structure(table1). $db2.table1 has new rows which
I have a custom DataContext with a Table member... Entry is defined as... [Table(Name=Entry)]
I have a table that contains members names and a field with multiple ID
I have a member function in a class that has a callback, but the
My User entity class have several member variables (e.g. String firstName) which are persisted
I have four tables: characters arena_team arena_table_member arena_team_stats. characters table has guid, name arena_team

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.