Skip to content

Update locallib.php#4

Open
vsotirasqmplus wants to merge 1 commit into
pauln:masterfrom
vsotirasqmplus:patch-1
Open

Update locallib.php#4
vsotirasqmplus wants to merge 1 commit into
pauln:masterfrom
vsotirasqmplus:patch-1

Conversation

@vsotirasqmplus

Copy link
Copy Markdown

Avoid Moodle Query duplicate records error by adding a unique id for each tuple

Avoid Moodle Query duplicate records error by adding a unique id for each tuple
@marcusgreen

Copy link
Copy Markdown
Collaborator

Could you elaborate on a situation where this update would be required? I am concerned that your code may not be portable across different database systems and the plugin should at least work with MysQL,Postgres and MS SQL Server.

@vsotirasqmplus

Copy link
Copy Markdown
Author

I am sure there could be conflicts with other databases than MySQL. but the basic principle of Moodle $DB object is to retrieve tuples having their first field to be a unique identifier, which in our installation was the case, forcing Moodle to abandon records and retrieve only the ones having distinct values at the first field. So my suggestion is for MySQL, and based on identifying other databases, the principle of the $DB object query must be kept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants