Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-8828

Old stats table may contains the same record with two different fullName

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 4.5
    • Old Core
    • Unknown

    Description

      It appears that some rare old databases may contains the same record (same classname and number) with the same fullname, but one of them precise the database name while the other don't. This cause the R40000XWIKI6990 migration to fails, since ids for the two record result to the same value.

      To properly clean a MySQL database before migrating to 4.x, you may use the following SQL statements:

       
      delete s1 from xwikistatsdoc s1 join xwikistatsdoc s2 
            on s1.XWS_NUMBER=s2.XWS_NUMBER and s1.XWS_CLASSNAME=s2.XWS_CLASSNAME 
         where (position(':' in s1.XWS_NAME) != 0 and s2.XWS_NAME = trim(leading ':' from substring(s1.XWS_NAME from position(':' in s1.XWS_NAME))));
      
      delete s1 from xwikistatsreferer s1 join xwikistatsreferer s2 
            on s1.XWR_NUMBER=s2.XWR_NUMBER and s1.XWR_CLASSNAME=s2.XWR_CLASSNAME 
         where (position(':' in s1.XWR_NAME) != 0 and s2.XWR_NAME = trim(leading ':' from substring(s1.XWR_NAME from position(':' in s1.XWR_NAME))));
      
      delete s1 from xwikistatsvisit s1 join xwikistatsvisit s2 
            on s1.XWV_NUMBER=s2.XWV_NUMBER and s1.XWV_CLASSNAME=s2.XWV_CLASSNAME 
         where (position(':' in s1.XWV_NAME) != 0 and s2.XWV_NAME = trim(leading ':' from substring(s1.XWV_NAME from position(':' in s1.XWV_NAME))));
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              softec Denis Gervalle
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: