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

MCOL-5932: Fix heap buffer overflow #3445

Open
wants to merge 2 commits into
base: stable-23.10
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build/bootstrap_mcs.sh
Original file line number Diff line number Diff line change
@@ -446,6 +446,10 @@ fix_config_files()
fi
fi

message Setting lowercase for tablenames and utf-8 as default encoding
sed -i "/^.mariadb.$/a lower_case_table_names=1" "$CONFIG_DIR/server.cnf"
sed -i "/^.client.$/a default-character-set=utf8" "$CONFIG_DIR/client.cnf"

message Reloading systemd
systemctl daemon-reload
}
6 changes: 4 additions & 2 deletions dbcon/joblist/joblistfactory.cpp
Original file line number Diff line number Diff line change
@@ -1129,7 +1129,8 @@ const JobStepVector doAggProject(const CalpontSelectExecutionPlan* csep, JobInfo
else
it = pcv.insert(pcv.end(), srcp);

projectKeys.insert(projectKeys.begin() + std::distance(pcv.begin(), it), tupleKey);
auto placeToInsert = std::distance(pcv.begin(), it);
projectKeys.insert(projectKeys.begin() + std::min(placeToInsert, projectKeys.end() - projectKeys.begin()), tupleKey);
}
else if (doDistinct) // @bug4250, move forward distinct column if necessary.
{
@@ -1300,7 +1301,8 @@ const JobStepVector doAggProject(const CalpontSelectExecutionPlan* csep, JobInfo
else
it = pcv.insert(pcv.end(), srcp);

projectKeys.insert(projectKeys.begin() + std::distance(pcv.begin(), it), tupleKey);
auto placeToInsert = std::distance(pcv.begin(), it);
projectKeys.insert(projectKeys.begin() + std::min(placeToInsert, projectKeys.end() - projectKeys.begin()), tupleKey);
}
else if (doDistinct) // @bug4250, move forward distinct column if necessary.
{
859 changes: 859 additions & 0 deletions mysql-test/columnstore/bugfixes/mcol-5932.result

Large diffs are not rendered by default.

868 changes: 868 additions & 0 deletions mysql-test/columnstore/bugfixes/mcol-5932.test

Large diffs are not rendered by default.