1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-11 12:22:51 +03:00

When comparing names during name resolution, make sure the names match

exactly and that one name isn't merely a prefix of the other.
Fix for ticket [7a31705a7e6c95d51].

FossilOrigin-Name: c2d5a23b1ab39918e97c596cf75c42f86a5fe2b7
This commit is contained in:
drh
2013-02-26 12:57:42 +00:00
parent 9cf37e718c
commit dd1dd489d9
4 changed files with 37 additions and 10 deletions

View File

@@ -165,12 +165,12 @@ int sqlite3MatchSpanName(
){
int n;
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
if( zDb && sqlite3StrNICmp(zSpan, zDb, n)!=0 ){
if( zDb && (sqlite3StrNICmp(zSpan, zDb, n)!=0 || zDb[n]!=0) ){
return 0;
}
zSpan += n+1;
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
if( zTab && sqlite3StrNICmp(zSpan, zTab, n)!=0 ){
if( zTab && (sqlite3StrNICmp(zSpan, zTab, n)!=0 || zTab[n]!=0) ){
return 0;
}
zSpan += n+1;