[SERVER-27761] view can be created on top of a view with different collation than underlying view Created: 19/Jan/17  Updated: 15/Aug/17  Resolved: 04/Apr/17

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.4.1
Fix Version/s: 3.4.4, 3.5.6

Type: Bug Priority: Major - P3
Reporter: Asya Kamsky Assignee: Kyle Suarez
Resolution: Done Votes: 0
Labels: read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Backport Requested:
v3.4
Steps To Reproduce:

db.createView("view2", "view1", [], {collation:{locale:"fr"}})
{ "ok" : 1 }
db.createView("view3", "view1", [], {collation:{locale:"en"}})
{ "ok" : 1 }
db.createView("view1", "names", [], {collation:{locale:"ja"}})
{ "ok" : 1 }

Sprint: Query 2017-03-27, Query 2017-04-17
Participants:

 Description   

If you create a view with collation on non-existent view and then create that underlying view with different collation, it seems to be allowed which violates "no overriding collation by view on top of another view".



 Comments   
Comment by Githook User [ 14/Apr/17 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}

Message: SERVER-27761 track collation in ViewGraph

Keeps track of the collation of views in the ViewGraph, to ensure that all views in the same
connected component share the same collation. This prohibits users from dropping a view and
recreating it with a different collation if other views depend on it.

(cherry picked from commit 476c7733f5dc01011e1ebd9d7818aad8d63a1781)

Conflicts:
jstests/core/views/views_collation.js
src/mongo/db/views/SConscript
src/mongo/db/views/view_graph.cpp
Branch: v3.4
https://github.com/mongodb/mongo/commit/94c5dff95cbeeb1da7d50738d1ceebe5251f528e

Comment by Githook User [ 04/Apr/17 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}

Message: SERVER-27761 track collation in ViewGraph

Keeps track of the collation of views in the ViewGraph, to ensure that all views in the same
connected component share the same collation. This prohibits users from dropping a view and
recreating it with a different collation if other views depend on it.
Branch: master
https://github.com/mongodb/mongo/commit/476c7733f5dc01011e1ebd9d7818aad8d63a1781

Comment by Asya Kamsky [ 19/Jan/17 ]

The same could happen if view is created on top of view with same collation, but then you can drop the underlying view and re-create it with a different collation...

Generated at Thu Feb 08 04:16:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.