Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N°5039 - DataSynchro: TEXT field too small for big linkset #479

Open
wants to merge 1 commit into
base: support/2.7
Choose a base branch
from

Conversation

Hipska
Copy link
Contributor

@Hipska Hipska commented Apr 12, 2023

This change is in order to be able to synchronise large linksets.

@piRGoif
Copy link
Contributor

piRGoif commented Apr 14, 2023

Hello Thomas,
Thanks for the contribution !

I see the method you modified will be called for datasource table creation in \SynchroDataSource::AfterInsert
But when the table already exists, seems like it will raise an error in \SynchroDataSource::CheckDBConsistency right ? Did you test it ?

@piRGoif piRGoif self-assigned this Apr 14, 2023
@piRGoif piRGoif added the enhancement New feature or request label Apr 14, 2023
@Hipska
Copy link
Contributor Author

Hipska commented Apr 14, 2023

Hmm, I only tested in iTop 3.0, but there the method was a bit different.

The consistency check will indeed complain, but wouldn't the setup try to update the column instead?

Edit: Seems to be the case for 3.0:

} elseif (!CMDBSource::IsSameFieldTypes($sColumnDef, CMDBSource::GetFieldSpec($sTable, $sColName))) {
$bFixNeeded = true;
$bOneColIsMissing = true;
if (count($aColumns) > 1) {
echo "Incorrect column '$sColName' (".CMDBSource::GetFieldSpec($sTable,
$sColName).' instead of '.$sColumnDef."), in the table '$sTable' for the data synchro task ".$this->GetName().' ('.$this->GetKey()."). The columns '".implode("', '",
$aColumns)." will be re-created.'.\n";
} else {
echo "Incorrect column '$sColName' (".CMDBSource::GetFieldSpec($sTable,
$sColName).' instead of '.$sColumnDef."), in the table '$sTable' for the data synchro task ".$this->GetName().' ('.$this->GetKey()."). The column '$sColName' will be re-created.\n";
}
}

if (CMDBSource::IsField($sTable, $sAttCode)) {
$aRepairQueries[] = "ALTER TABLE `$sTable` CHANGE `$sAttCode` `$sAttCode` $sColumnDef";

And also for 2.7:
elseif (strcasecmp(CMDBSource::GetFieldType($sTable, $sColName), $sColumnDef) != 0)
{
$bFixNeeded = true;
$bOneColIsMissing = true;
if (count($aColumns) > 1)
{
echo "Incorrect column '$sColName' (".CMDBSource::GetFieldType($sTable,
$sColName).' instead of '.$sColumnDef."), in the table '$sTable' for the data synchro task ".$this->GetName().' ('.$this->GetKey()."). The columns '".implode("', '",
$aColumns)." will be re-created.'.\n";
}
else
{
echo "Incorrect column '$sColName' (".CMDBSource::GetFieldType($sTable,
$sColName).' instead of '.$sColumnDef."), in the table '$sTable' for the data synchro task ".$this->GetName().' ('.$this->GetKey()."). The column '$sColName' will be added.\n";
}
}

if (CMDBSource::IsField($sTable, $sAttCode))
{
$aRepairQueries[] = "ALTER TABLE `$sTable` CHANGE `$sAttCode` `$sAttCode` $sColumnDef";
}

@Hipska
Copy link
Contributor Author

Hipska commented Apr 27, 2023

@piRGoif ?

@Hipska
Copy link
Contributor Author

Hipska commented Jun 13, 2023

@piRGoif any feedback?

Also, what is the pending contributor update you are awaiting from me?

@Hipska
Copy link
Contributor Author

Hipska commented Jun 23, 2023

@piRGoif?

@piRGoif
Copy link
Contributor

piRGoif commented Jun 26, 2023

Hello,
Sorry with the work on the 3.1 release I had very little time. Will try to get back to this PR during upcoming weeks.

@Hipska
Copy link
Contributor Author

Hipska commented Sep 14, 2023

Hello @piRGoif do you have any update for me please?

image
What update do you expect from me?

@Hipska
Copy link
Contributor Author

Hipska commented Sep 25, 2023

@piRGoif ?

@piRGoif piRGoif removed their assignment Sep 25, 2023
@piRGoif
Copy link
Contributor

piRGoif commented Sep 25, 2023

Hello,
Sorry no possibility for me to handle this PR. Setting it back in the backlog.

@Molkobain Molkobain self-assigned this Dec 5, 2023
@Molkobain
Copy link
Member

Functional review:

  • A workaround exists: synchronize the linkset table directly, but it's not a friendly solution
  • Ensure that there will be no performance issue during migration (Guillaume)
  • Ensure that DS tables are rebuilt during the setup (Guillaume) so the format of the column changes

@Hipska
Copy link
Contributor Author

Hipska commented Feb 26, 2024

@Molkobain when will the technical review happen? I see the PR is still on "pending functional review" on the dashboard..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Pending Combodo update
3 participants