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 8698525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:44:58+00:00 2026-06-13T01:44:58+00:00

Under User-Defined Variables , the MySQL manual documents: User variables can be assigned a

  • 0

Under User-Defined Variables, the MySQL manual documents:

User variables can be assigned a value from a limited set of data types: integer, decimal, floating-point, binary or nonbinary string, or NULL value. Assignment of decimal and real values does not preserve the precision or scale of the value. A value of a type other than one of the permissible types is converted to a permissible type. For example, a value having a temporal or spatial data type is converted to a binary string.

If a user variable is assigned a nonbinary (character) string value, it has the same character set and collation as the string. The coercibility of user variables is implicit. (This is the same coercibility as for table column values.)

However the manual does not state:

  • the size of supported integers (e.g. 4-byte INT, or 8-byte BIGINT), whether they are signed or unsigned, and whether ZEROFILL is applied (if so, using what display width);

    This sqlfiddle appears to suggest that MySQL 5.5.25 will use up to BIGINT, signed according to the assignment, and will not apply any ZEROFILL.

  • the precision and scale used in fixed- and floating-point values, given that this is not preserved from the assignment; and

  • the maximum length (in characters and/or bytes) of strings.

    sqlfiddle is limited by max_allowed_packet of 220 bytes (which I can’t change): I’d guess that LONGTEXT of 232 bytes (4GiB) is supported.

What limits can be safely relied upon, especially across different server versions and configurations?

  • 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-06-13T01:44:59+00:00Added an answer on June 13, 2026 at 1:44 am

    User variables use the same internal data types that MySQL uses for computations on column values. These internal types are big enough for all data types supported by MySQL.

    • Integers do not have ZEROFILL, as that is an additional property of the column, not of the data type itself. Furthermore, integer user variables do not have a width; when converted to text, they use just as many digits as needed.
    • Floating-point values do not have a scale. 64-bit IEEE floats are binary values, and have enough precision for about 18 decimal digits.
    • Strings should, in theory, hold any LONGTEXT value, if max_allowed_packet is large enough and you have enough memory. However, there is an undocumented limit of 16 MB for user variables, mentioned in bug 31898.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am on Linux, obviously. PHP scripts seem to be running under 'www-data' user.
I have defined a user control, ExpressionControl, under the namespace: TriggerEditor.UserControls I have a
I want to install MSI package under user level and set several registry keys
I'm trying to code a user defined function under SQL Server 2005 that will
I'm currently writing a serialization module in Python that can serialize user defined classes.
I just defined a live template under User Templates, however, typing the shortcut +
My application just got rejected from Apple because I store my resources under Documents
We have an older VB6 application that used to run under various user's accounts.
I enter command apt-get install apache2 --fix-missing (under the root user) and this is
Is there possible, to have some projects under a certain user.name and user.email and

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.