You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- 1+1 for the typecasting comment. To add on to this when working with programming languages avoid using lazy programming techniques in favor of consistency. Use identical operators instead of just equals. In the case of PHP if( $var == "" ) will be true for 0, false, null, undefined, and "". to test all of the values it is often best to use if( true === empty( $var ) ) as it will avoid the undefined errors as well. You should also validate the data type you are working with if( is_int( $var ) && $var === 0 ) or typecast it to force it into being a specific data type (int) $var for the task.Will B.– Will B.2014-01-17 01:35:12 +00:00Commented Jan 17, 2014 at 1:35
- @Thor is this true for MySQL to the same extent it is true for MSSQL? I am migrating a new application that has not gone into production yet from MSSQL to MySQL. I'm not using PHP but rather converting C# over to Java 8. Given that Java is a strongly typed language I am not worried about type handling ... just all the bit flags that would move from one byte for up to 8 flags to 1 byte each flag given TINYINT(1). Do you know of any documentation on this topic for MySQL?Zack Jannsen– Zack Jannsen2016-02-02 20:29:47 +00:00Commented Feb 2, 2016 at 20:29
- 1@Thor Doing some deeper research it is clear what the answer should be. Change does happen and we have seen improvements in this handling. Know your language that will be in the Application Layer / Data Access Layer and know your libraries support. I am using Java currently and BIT(1) is the recommended choice at this time for libraries like Hybernate and use of JDBC. Here is the URL [See table 5.2]: dev.mysql.com/doc/connector-j/en/…Zack Jannsen– Zack Jannsen2016-02-03 11:43:01 +00:00Commented Feb 3, 2016 at 11:43
- 1prove with a resource link that 8 bit(1) columns take the same byte... I've searched for a while and nowhere have I found it...assensi– assensi2020-12-30 18:48:33 +00:00Commented Dec 30, 2020 at 18:48
- i think this is actually not true in practice (isam)Erik Aronesty– Erik Aronesty2024-02-02 22:33:40 +00:00Commented Feb 2, 2024 at 22:33
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. python-3.x), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-sql