Doctrine Project

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Doctrine 2 - ORM
  • Doctrine 2 - ORM
  • DDC-1048

Boolean type issue

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Cannot Reproduce
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Mapping Drivers, ORM
  • Security Level: All
  • Labels:
    None
  • Environment:
    MySQL, pdo_mysql, Symfony2

Description

I'm having issues working with Doctrine2 boolean type. My mapping is basic:

	/**
	 * @orm:Column(type="boolean", nullable=false, name="is_deleted")
	 */
	protected $isDeleted;

When I'm trying to flush the object with $isDeleted=false (or true), the entity is not being added to the db. However when I set $isDeleted='0' (or '1') everything works fine.

I saw plenty of examples where people were using true and false, instead of '0' and '1'. But with MySQL it doesn't work. Doctrine maps boolean field as TINYINT(1) in MySQL. And I can see in Symfony2 Profiler the parameter in the query is "false"/"true", so here is data type conflict.

Doctrine doesn't transform true/false to 1/0 values.

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. DDC-1394 Boolean literals in DQL queries get translated wrongly on PostgreSQL (PDOException)

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

  • All
  • Comments
  • History
  • Activity
  • Source

People

  • Assignee:
    Benjamin Eberlei
    Reporter:
    Nikita Korotaev
Vote (0)
Watch (4)

Dates

  • Created:
    27/Feb/11 11:32 AM
    Updated:
    12/Apr/13 1:10 AM
    Resolved:
    15/Mar/12 9:46 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Doctrine Project. Try JIRA - bug tracking software for your team.