<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8895</bug_id>
          
          <creation_ts>2016-01-07 14:15:26 +0000</creation_ts>
          <short_desc>Lsupdates throw error using mysql</short_desc>
          <delta_ts>2016-01-21 09:54:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1 M3</target_milestone>
          <dependson>8796</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexandru Roman">alexandru.costinx.roman</reporter>
          <assigned_to name="Alexandru Roman">alexandru.costinx.roman</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Alexandru Roman">alexandru.costinx.roman</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>Unknown (Hard to categorize)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57620</commentid>
    <comment_count>0</comment_count>
    <who name="Alexandru Roman">alexandru.costinx.roman</who>
    <bug_when>2016-01-07 14:15:26 +0000</bug_when>
    <thetext>Steps to reproduce:

1. Modify poky/bitbake/lib/toaster/toastermain/settings.py file to use mysql
Example: DATABASES = {
         &apos;default&apos;: {
             &apos;ENGINE&apos;: &apos;django.db.backends.mysql&apos;,
             &apos;NAME&apos;: &apos;toaster_data&apos;,
             &apos;USER&apos;: &apos;toaster&apos;,
             &apos;PASSWORD&apos;: &apos;12345&apos;,
             &apos;HOST&apos;: &apos;127.0.0.1&apos;,
             &apos;PORT&apos;: &apos;&apos;,
     }

2. Create database and user in mysql:
$ mysql -u root -p
     mysql&gt; CREATE DATABASE toaster_data;
     mysql&gt; CREATE USER &apos;toaster&apos;@&apos;localhost&apos; identified by &apos;12345&apos;;
     mysql&gt; GRANT all on toaster_data.* to &apos;toaster&apos;@&apos;localhost&apos;;
     mysql&gt; quit

3. run command: ./bitbake/lib/toaster/manage.py migrate

4. run command: ./bitbake/lib/toaster/manage.py lsupdates

Expected results:
 Command finished successfully.

Actually:
 An error is thrown:
  &quot;An error occurred in the current transaction. You can&apos;t &quot;
django.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can&apos;t execute queries until the end of the &apos;atomic&apos; block.

If you use sqlite3 lsupdates works fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57995</commentid>
    <comment_count>1</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-01-20 13:54:13 +0000</bug_when>
    <thetext>Started to work on this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57996</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-01-20 14:06:34 +0000</bug_when>
    <thetext>Works for me just fine on master 68c7113a746694e25df2ac5d86171ed96b7c2e94: 

$ ../bitbake/lib/toaster/manage.py migrate
Operations to perform:
  Synchronize unmigrated apps: staticfiles, messages, toastermain, bldcollector, toastergui, humanize
  Apply all migrations: sessions, admin, auth, contenttypes, orm, bldcontrol
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying orm.0001_initial... OK
  Applying bldcontrol.0001_initial... OK
  Applying orm.0002_auto_20151223_1528... OK
  Applying sessions.0001_initial... OK
$ ../bitbake/lib/toaster/manage.py lsupdates
$ echo $?
0

Assigning back to reporter. Please, try to reproduce it on current master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57999</commentid>
    <comment_count>3</comment_count>
    <who name="Alexandru Roman">alexandru.costinx.roman</who>
    <bug_when>2016-01-20 14:59:50 +0000</bug_when>
    <thetext>Tested again on master: 68c7113a746694e25df2ac5d86171ed96b7c2e94 and works.
Put this on resolved worksforme.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58046</commentid>
    <comment_count>4</comment_count>
    <who name="Alexandru Roman">alexandru.costinx.roman</who>
    <bug_when>2016-01-21 09:54:05 +0000</bug_when>
    <thetext>Verified.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>