[Approved] Case sensitivity in query (CRASH on MySQL) (1 Viewer)

Oxan

Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Since r25307, the query on line 948 of TVLibrary/TVDatabase/Program.cs is broken on MySQL: It states Update program instead of Update Program. This leads to crashes of MediaPortal. Please apply the patch, based on SVN r26092. (maybe you need to adjust the paths, checking out the whole SVN tree was way too slow, so I've only checked out the TVDatabase directory).

    crash details in log:
    Code:
    Gentle.Common.GentleException: Update program set state=0 where state<>0; ---> MySql.Data.MySqlClient.MySqlException: Table 'mediaportal.program' doesn't exist
       at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
       at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId)
       at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
       at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
       at Gentle.Framework.SqlStatement.Execute(IDbConnection conn, IDbTransaction tr)
       --- End of inner exception stack trace ---
       at Gentle.Framework.SqlStatement.Execute(IDbConnection conn, IDbTransaction tr)
       at Gentle.Framework.PersistenceBroker.Execute(SqlStatement stmt, IDbConnection dbConnection, IDbTransaction dbTransaction)
       at Gentle.Framework.SqlStatement.Execute()
       at TvDatabase.Program.ResetAllStates()
       at TvService.TVController.InitController()MySql.Data.MySqlClient.MySqlException: Table 'mediaportal.program' doesn't exist
       at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
       at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId)
       at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
       at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
       at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
       at Gentle.Framework.SqlStatement.Execute(IDbConnection conn, IDbTransaction tr)
       at Gentle.Framework.SqlStatement.Execute(IDbConnection conn, IDbTransaction tr)
       at Gentle.Framework.PersistenceBroker.Execute(SqlStatement stmt, IDbConnection dbConnection, IDbTransaction dbTransaction)
       at Gentle.Framework.SqlStatement.Execute()
       at TvDatabase.Program.ResetAllStates()
       at TvService.TVController.InitController()
     

    Attachments

    • mediaportal_bug.patch
      584 bytes

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    This is only an issue with mySQL on a linux, mySQL on windows is not case-sensitive.

    There are lots of cases where the case in code does not match that in database. Not sure what was agreed about fixing this as there are lots of fixes needed and hence lots of testing
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Yes, my MySQL server is running on Linux. I haven't got a crash from another failing SQL statement, so I guess there aren't any other serious bugs. However, I think that with a little scripting you can find all case-sensitivity faults and correct them. Perhaps some regular expression?

    Anyway, I would love it to see the patch applied so I don't have to manually build MediaPortal.
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    49
    Milano, Italy
    Home Country
    Italy Italy
    will commit this change but I want to be clear: MySQL on Linux is still not supported !

    Simone
     

    Ruud

    MP Donator
  • Premium Supporter
  • December 5, 2004
    276
    6
    Home Country
    Netherlands Netherlands
    Yes, my MySQL server is running on Linux. I haven't got a crash from another failing SQL statement, so I guess there aren't any other serious bugs. However, I think that with a little scripting you can find all case-sensitivity faults and correct them. Perhaps some regular expression?

    Anyway, I would love it to see the patch applied so I don't have to manually build MediaPortal.

    Hoi Oxan,

    thanks for your patch. I am also running mysql on linux and have the same error you described.
    Does your patch also fix the mini tv guide being empty (when in live tv press enter to display the mini tv guide)? As a non-developer I have to (unfortunately) wait until the next release that includes your patch :(

    keep up the good work!

    regards,
    Ruud.
     

    Fabrix67

    Portal Member
    February 15, 2010
    33
    3
    Home Country
    Italy Italy
    Hi @ll,

    I suggest a simpler way to solve - temporary till new version:) - this issue without alter typical configuration of MySQL on Linux (since I'm also using MySql on a QNAP TS439 just to make some test with MP...).

    You can create an updatable view "program" connecting to your MpTvDb DataBase (f.e. example using mysql) and run this commands:

    mysql> use MpTvDb;
    mysql> create view program as select * from Program ;

    it's not the best solution, but for sure is most elegant ;)

    ciao

    Fabrizio
     

    Users who are viewing this thread

    Top Bottom